Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Cypress - added @tag.excludeForAirgap, @tag.Templates tags #29790

Merged
merged 14 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/ci-test-custom-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,17 @@ jobs:
run: |
yarn install --immutable

- name: Set cypress tags to exclude
if: steps.run_result.outputs.run_result != 'success'
run: |
echo 'tags_to_exclude=airgap' >> "$GITHUB_ENV"
echo "CYPRESS_grepTags=${{ inputs.tags }}" >> $GITHUB_ENV

- name: Print the tags
run: |
echo "tags_to_exclude: ${{ env.tags_to_exclude }}"
echo "_grepTags: ${{ env.CYPRESS_grepTags }}"

- name: Setting up the cypress tests
if: steps.run_result.outputs.run_result != 'success'
shell: bash
Expand Down Expand Up @@ -307,7 +318,7 @@ jobs:
CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_JWKS_URL }}
CYPRESS_APPSMITH_OAUTH2_OIDC_OKTA_PASSWORD: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_OKTA_PASSWORD }}
CYPRESS_APPSMITH_OAUTH2_OIDC_DIRECT_URL: ${{ secrets.CYPRESS_APPSMITH_OAUTH2_OIDC_DIRECT_URL }}
CYPRESS_EXCLUDE_TAGS: "airgap"
CYPRESS_EXCLUDE_TAGS: ${{ env.tags_to_exclude }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sharanya-appsmith Now that we are moving to cypress-grep library, is this environment variable effective and/or required? To the best of my understanding, if we wish to exclude any tags, we need to add it to the grepTags list with the - prefix. Is my understanding incorrect?

Copy link
Contributor Author

@sharanya-appsmith sharanya-appsmith Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly it blocks has been tagged with airgap and we have not modified airgap using cypress-grep because currently our cypress parallelization plugin is not able to handle if individual it blocks are tagged. Hence leaving it with env variables.

CYPRESS_AIRGAPPED: false
APPSMITH_DISABLE_TELEMETRY: true
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
Expand All @@ -329,7 +340,7 @@ jobs:
CYPRESS_DB_PWD: ${{ secrets.CYPRESS_DB_PWD }}
CYPRESS_S3_ACCESS: ${{ secrets.CYPRESS_S3_ACCESS }}
CYPRESS_S3_SECRET: ${{ secrets.CYPRESS_S3_SECRET }}
CYPRESS_grepTags: ${{ inputs.tags }} # This is a comma separated list of tags to run a subset of the suite
CYPRESS_grepTags: ${{ env.CYPRESS_grepTags }} # This is a comma separated list of tags to run a subset of the suite
CYPRESS_SKIP_FLAKY: true
CYPRESS_STATIC_ALLOCATION: true
DEBUG: ${{secrets.CYPRESS_GREP_DEBUG }} # This is derived from secrets so that we can toggle it without having to change any workflow. Only acceptable value is: @cypress/grep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
});

it(
"excludeForAirgap",
"4. Should test that settings page tab redirects",
{ tags: ["@tag.excludeForAirgap"] },
() => {
Expand Down Expand Up @@ -93,7 +92,6 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
);

it(
"excludeForAirgap",
"5. Should test that authentication page redirects",
{ tags: ["@tag.excludeForAirgap"] },
() => {
Expand Down Expand Up @@ -129,7 +127,6 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
);

it(
"excludeForAirgap",
"6. Should test that configure link redirects to google signup setup doc",
{ tags: ["@tag.excludeForAirgap"] },
() => {
Expand All @@ -149,7 +146,6 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
);

it(
"excludeForAirgap",
"7. Should test that configure link redirects to github signup setup doc",
{ tags: ["@tag.excludeForAirgap"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ describe("Autocomplete bug fixes", { tags: ["@tag.JS"] }, function () {
});

it(
"excludeForAirgap",
"7. Installed library should show up in autocomplete",
{ tags: ["@tag.excludeForAirgap"] },
function () {
AppSidebar.navigate(AppSidebarButton.Libraries);
installer.OpenInstaller();
Expand All @@ -106,8 +106,8 @@ describe("Autocomplete bug fixes", { tags: ["@tag.JS"] }, function () {
);

it(
"excludeForAirgap",
"8. No autocomplete for Removed libraries",
{ tags: ["@tag.excludeForAirgap"] },
function () {
entityExplorer.RenameEntityFromExplorer("Text1Copy", "UUIDTEXT");
AppSidebar.navigate(AppSidebarButton.Libraries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const testdata = require("../../../../fixtures/testdata.json");
import * as _ from "../../../../support/Objects/ObjectsCore";

describe(
"excludeForAirgap",
"Binding the Button widget with Text widget using Recpatcha v3",
{ tags: ["@tag.excludeForAirgap", "@tag.Binding"] },
function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
import * as _ from "../../../../support/Objects/ObjectsCore";

describe(
"excludeForAirgap",
"Welcome tour spec",
{ tags: ["@tag.excludeForAirgap"] },
function () {
it("1. Bug: 22275: Debugger should not render in preview mode", function () {
//Open debugger
_.agHelper.GetNClick(_.debuggerHelper.locators._debuggerIcon);
//Enter preview mode
_.agHelper.GetNClick(_.locators._enterPreviewMode);
//verify debugger is not present
_.agHelper.AssertElementAbsence(_.locators._errorTab);
//Exit preview mode
_.agHelper.GetNClick(_.locators._exitPreviewMode);
//verify debugger is present
_.agHelper.GetNAssertContains(_.locators._errorTab, "Errors");
});
it("2. Bug: 22281: Debugger should not open by default in welcome tour", function () {
//Get back to application page
_.homePage.NavigateToHome();
_.agHelper.WaitUntilEleAppear(_.homePage._homePageAppCreateBtn);

// Temporary workaround until https://github.com/appsmithorg/appsmith/issues/24665 is fixed
_.agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
_.homePage.CreateNewWorkspace("GuidedtourWorkspace" + uid);
_.homePage.CreateAppInWorkspace(
"GuidedtourWorkspace" + uid,
`GuidedtourApp${uid}`,
);
_.homePage.NavigateToHome();
});
describe("Welcome tour spec", { tags: ["@tag.excludeForAirgap"] }, function () {
it("1. Bug: 22275: Debugger should not render in preview mode", function () {
//Open debugger
_.agHelper.GetNClick(_.debuggerHelper.locators._debuggerIcon);
//Enter preview mode
_.agHelper.GetNClick(_.locators._enterPreviewMode);
//verify debugger is not present
_.agHelper.AssertElementAbsence(_.locators._errorTab);
//Exit preview mode
_.agHelper.GetNClick(_.locators._exitPreviewMode);
//verify debugger is present
_.agHelper.GetNAssertContains(_.locators._errorTab, "Errors");
});
it("2. Bug: 22281: Debugger should not open by default in welcome tour", function () {
//Get back to application page
_.homePage.NavigateToHome();
_.agHelper.WaitUntilEleAppear(_.homePage._homePageAppCreateBtn);

//Start welcome tour
_.agHelper.GetNClick(_.homePage._welcomeTour);
_.agHelper.WaitUntilEleAppear(_.homePage._welcomeTourBuildingButton);
//Verify debugger is not present
_.agHelper.AssertElementAbsence(_.locators._errorTab);
// Temporary workaround until https://github.com/appsmithorg/appsmith/issues/24665 is fixed
_.agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
_.homePage.CreateNewWorkspace("GuidedtourWorkspace" + uid);
_.homePage.CreateAppInWorkspace(
"GuidedtourWorkspace" + uid,
`GuidedtourApp${uid}`,
);
_.homePage.NavigateToHome();
});
},
);

//Start welcome tour
_.agHelper.GetNClick(_.homePage._welcomeTour);
_.agHelper.WaitUntilEleAppear(_.homePage._welcomeTourBuildingButton);
//Verify debugger is not present
_.agHelper.AssertElementAbsence(_.locators._errorTab);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ const dataSources = ObjectsRegistry.DataSources,
agHelper = ObjectsRegistry.AggregateHelper;

describe(
"excludeForAirgap",
"Bug 18035: Updates save button text on datasource discard popup",
{ tags: ["@tag.Datasource"] },
{ tags: ["@tag.Datasource", "@tag.excludeForAirgap"] },
function () {
it("1. Create gsheet datasource, click on back button, discard popup should contain save and authorize", function () {
dataSources.NavigateToDSCreateNew();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import EditorNavigation, {
let dsName: any, userMock: string, movieMock: string;

describe(
"excludeForAirgap",
"Bug 26716: Datasource selected from entity explorer should be correctly highlighted",
{ tags: ["@tag.Datasource"] },
{ tags: ["@tag.Datasource", "@tag.excludeForAirgap"] },
function () {
it("1. Create users and movies mock datasources and switch between them through entity explorer, check the active state", function () {
dataSources.CreateMockDB("Users").then((mockDBName) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";

describe(
"Datasource structure schema preview data",
{ tags: ["@tag.Datasource"] },
{ tags: ["@tag.Datasource", "@tag.excludeForAirgap"] },
() => {
before(() => {
featureFlagIntercept({ ab_gsheet_schema_enabled: true });
dataSources.CreateMockDB("Users");
});

it(
"excludeForAirgap",
"1. Verify if the schema table accordions is collapsed in case of search",
() => {
agHelper.TypeText(
dataSources._datasourceStructureSearchInput,
"public.us",
);
agHelper.Sleep(1000);
agHelper.AssertElementAbsence(
`${dataSources._dsStructurePreviewMode} ${dataSources._datasourceSchemaColumn}`,
);
},
);
it("1. Verify if the schema table accordions is collapsed in case of search", () => {
agHelper.TypeText(
dataSources._datasourceStructureSearchInput,
"public.us",
);
agHelper.Sleep(1000);
agHelper.AssertElementAbsence(
`${dataSources._dsStructurePreviewMode} ${dataSources._datasourceSchemaColumn}`,
);
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import EditorNavigation, {
} from "../../../../support/Pages/EditorNavigation";

describe(
"excludeForAirgap",
"Fix UQI query switching",
{ tags: ["@tag.Datasource"] },
{ tags: ["@tag.Datasource", " @tag.excludeForAirgap"] },
function () {
it("1. The command of the Mongo query must be preserved and should not default to initial value after changed.", function () {
dataSources.NavigateToDSCreateNew();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe(
});

it(
"excludeForAirgap",
"3. Verify if schema (table and column) exist in query editor and searching works",
{ tags: ["@tag.excludeForAirgap"] },
() => {
agHelper.RefreshPage();
dataSources.CreateMockDB("Users");
Expand All @@ -87,8 +87,8 @@ describe(
);

it(
"excludeForAirgap",
"4. Verify if collapsible opens when refresh button is opened.",
{ tags: ["@tag.excludeForAirgap"] },
() => {
agHelper.RefreshPage();
dataSources.CreateMockDB("Users");
Expand Down
Loading
Loading