Skip to content

Commit

Permalink
Merge pull request #11641 from yonasberhe23/split_explorer_test_suite
Browse files Browse the repository at this point in the history
automation: split explorer tests into two buckets
  • Loading branch information
yonasberhe23 authored Aug 27, 2024
2 parents 01c5bb4 + 5312b44 commit 76ee305
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 27 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
['@navigation', '@extensions'],
['@charts'],
['@explorer'],
['@explorer2'],
['@fleet'],
['@generic', '@globalSettings'],
['@manager'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ describe('CustomResourceDefinitions', { testIsolation: 'off', tags: ['@explorer'
// navigate to last page - end button
crdsPage.sortableTable().pagination().endButton().click();

// row count on last page
let lastPageCount = count % 10;

if (lastPageCount === 0) {
lastPageCount = 10;
}

// check text after navigation
crdsPage.sortableTable().pagination().paginationText().then((el) => {
expect(el.trim()).to.contain(`${ count - (count % 10) + 1 } - ${ count } of ${ count } CustomResourceDefinitions`);
expect(el.trim()).to.contain(`${ count - (lastPageCount) + 1 } - ${ count } of ${ count } CustomResourceDefinitions`);
});

// navigate to first page - beginning button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const runPrefix = `e2e-test-${ runTimestamp }`;
const username = `${ runPrefix }-cluster-proj-member`;
const standardPassword = 'standard-password';

describe.skip('[Vue3 Skip]: Cluster Project and Members', { tags: ['@explorer', '@adminUser'] }, () => {
describe.skip('[Vue3 Skip]: Cluster Project and Members', { tags: ['@explorer2', '@adminUser'] }, () => {
it('Members added to both Cluster Membership should not show "Loading..." next to their names', () => {
const usersAdmin = new UsersPo('_');
const userCreate = usersAdmin.createEdit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PromptRemove from '@/cypress/e2e/po/prompts/promptRemove.po';

const clusterTools = new ClusterToolsPagePo('local');

describe('Cluster Tools', { tags: ['@explorer', '@adminUser'] }, () => {
describe('Cluster Tools', { tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PagePo from '@/cypress/e2e/po/pages/page.po';

describe('Explorer Index', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe('Explorer Index', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.closeDropdown();
});

it('can filter workloads by project/namespace from the picker dropdown', { tags: ['@explorer', '@adminUser'] }, () => {
it('can filter workloads by project/namespace from the picker dropdown', { tags: ['@explorer2', '@adminUser'] }, () => {
// Verify 'Namespace: cattle-fleet-system' appears once when filtering by Namespace
// Verify multiple namespaces within Project: System display when filtering by Project

Expand Down Expand Up @@ -61,7 +61,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
workloadsPodPage.sortableTable().groupElementWithName('cattle-fleet-system').scrollIntoView().should('be.visible');
});

it('can select only one of the top 5 resource filters at a time', { tags: ['@explorer', '@adminUser', '@standardUser'] }, () => {
it('can select only one of the top 5 resource filters at a time', { tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
// Verify that user can only select one of the first 5 options

namespacePicker.toggle();
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.checkIcon().should('have.length', 1);
});

it('can select multiple projects/namespaces', { tags: ['@explorer', '@adminUser'] }, () => {
it('can select multiple projects/namespaces', { tags: ['@explorer2', '@adminUser'] }, () => {
// Verify that user can select multiple options (other than the first 5 options)

namespacePicker.toggle();
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.moreOptionsSelected().should('have.class', 'v-popper--has-tooltip');
});

it('can deselect options', { tags: ['@explorer', '@adminUser', '@standardUser'] }, () => {
it('can deselect options', { tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
namespacePicker.toggle();

// Select 'default' option
Expand All @@ -153,7 +153,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.checkIcon().should('have.length', 1);
});

it('can filter options by name', { tags: ['@explorer', '@adminUser', '@standardUser'] }, () => {
it('can filter options by name', { tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
namespacePicker.toggle();

// filter 'cattle-fleet'
Expand All @@ -174,7 +174,7 @@ describe('Namespace picker', { testIsolation: 'off' }, () => {
namespacePicker.checkIcon().should('have.length', 1);
});

it('newly created project/namespace appears in namespace picker', { tags: ['@explorer', '@adminUser'] }, () => {
it('newly created project/namespace appears in namespace picker', { tags: ['@explorer2', '@adminUser'] }, () => {
const projName = `project${ +new Date() }`;
const nsName = `namespace${ +new Date() }`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ClusterDashboardPagePo from '@/cypress/e2e/po/pages/explorer/cluster-dash
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';

describe('Nodes list', { tags: ['@explorer', '@adminUser'], testIsolation: 'off' }, () => {
describe('Nodes list', { tags: ['@explorer2', '@adminUser'], testIsolation: 'off' }, () => {
before(() => {
cy.login();
HomePagePo.goTo();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ProjectsNamespacesPagePo from '@/cypress/e2e/po/pages/explorer/projects-namespaces.po';

describe('Projects/Namespaces', { tags: ['@explorer', '@adminUser'] }, () => {
describe('Projects/Namespaces', { tags: ['@explorer2', '@adminUser'] }, () => {
const projectsNamespacesPage = new ProjectsNamespacesPagePo('local');

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ConfigMapPagePo } from '@/cypress/e2e/po/pages/explorer/config-map.po';

const clusterDashboard = new ClusterDashboardPagePo('local');

describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer', '@adminUser', '@standardUser'] }, () => {
describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
before(() => {
cy.login();
HomePagePo.goTo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ConfigMapPo from '@/cypress/e2e/po/components/storage/config-map.po';

const configMapPage = new ConfigMapPagePo('local');

describe.skip('[Vue3 Skip]: ConfigMap', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe.skip('[Vue3 Skip]: ConfigMap', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PersistentVolumeClaimsPagePo } from '@/cypress/e2e/po/pages/explorer/pe

const persistentVolumeClaimsPage = new PersistentVolumeClaimsPagePo();

describe('PersistentVolumeClaims', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe('PersistentVolumeClaims', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { generatePersistentVolumesDataSmall, persistentVolumesNoData } from '@/c

const persistentVolumesPagePo = new PersistentVolumesPagePo();

describe('PersistentVolumes', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe('PersistentVolumes', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StorageClassesPagePo } from '@/cypress/e2e/po/pages/explorer/storage-cl

const storageClassesPagePo = new StorageClassesPagePo();

describe('StorageClasses', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe('StorageClasses', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
before(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WorkloadsDaemonsetsListPagePo, WorkLoadsDaemonsetsEditPagePo } from '@/cypress/e2e/po/pages/explorer/workloads-daemonsets.po';

describe('Cluster Explorer', { tags: ['@explorer', '@adminUser'] }, () => {
describe('Cluster Explorer', { tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Cluster Explorer', () => {
cy.login();
});

describe('Workloads', { tags: ['@explorer', '@standardUser', '@adminUser', '@flaky'] }, () => {
describe('Workloads', { tags: ['@explorer2', '@standardUser', '@adminUser', '@flaky'] }, () => {
let deploymentsListPage: WorkloadsDeploymentsListPagePo;
let deploymentsCreatePage: WorkloadsDeploymentsCreatePagePo;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WorkloadsJobsListPagePo, WorkLoadsJobDetailsPagePo } from '@/cypress/e2e/po/pages/explorer/workloads-jobs.po';

describe('Cluster Explorer', { tags: ['@explorer', '@adminUser'] }, () => {
describe('Cluster Explorer', { tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PromptRemove from '@/cypress/e2e/po/prompts/promptRemove.po';
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
import { generatePodsDataSmall } from '@/cypress/e2e/blueprints/explorer/workloads/pods/pods-get';

describe('Pods', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, () => {
describe('Pods', { testIsolation: 'off', tags: ['@explorer2', '@adminUser'] }, () => {
const workloadsPodPage = new WorkloadsPodsListPagePo('local');

before(() => {
Expand Down Expand Up @@ -100,9 +100,16 @@ describe('Pods', { testIsolation: 'off', tags: ['@explorer', '@adminUser'] }, ()
// navigate to last page - end button
workloadsPodPage.sortableTable().pagination().endButton().click();

// row count on last page
let lastPageCount = count % 10;

if (lastPageCount === 0) {
lastPageCount = 10;
}

// check text after navigation
workloadsPodPage.sortableTable().pagination().paginationText().then((el) => {
expect(el.trim()).to.eq(`${ count - (count % 10) + 1 } - ${ count } of ${ count } Pods`);
expect(el.trim()).to.eq(`${ count - (lastPageCount) + 1 } - ${ count } of ${ count } Pods`);
});

// navigate to first page - beginning button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import WorkloadPagePo from '@/cypress/e2e/po/pages/explorer/workloads.po';

const podName = 'some-pod-name';

describe('Workloads', { tags: ['@explorer', '@adminUser'] }, () => {
describe('Workloads', { tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
9 changes: 8 additions & 1 deletion cypress/e2e/tests/pages/user-menu/account-api-keys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,16 @@ describe('Account and API Keys', { testIsolation: 'off' }, () => {
// navigate to last page - end button
accountPage.sortableTable().pagination().endButton().click();

// row count on last page
let lastPageCount = count % 10;

if (lastPageCount === 0) {
lastPageCount = 10;
}

// check text after navigation
accountPage.sortableTable().pagination().paginationText().then((el) => {
expect(el.trim()).to.eq(`${ count - (count % 10) + 1 } - ${ count } of ${ count } API Keys`);
expect(el.trim()).to.eq(`${ count - (lastPageCount) + 1 } - ${ count } of ${ count } API Keys`);
});

// navigate to first page - beginning button
Expand Down
9 changes: 8 additions & 1 deletion cypress/e2e/tests/pages/users-and-auth/roles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,17 @@ describe('Roles Templates', { tags: ['@usersAndAuths', '@adminUser'] }, () => {
// navigate to last page - end button
paginatedRoleTab.endButton().click();

// row count on last page
let lastPageCount = count % 10;

if (lastPageCount === 0) {
lastPageCount = 10;
}

// check text after navigation
paginatedRoleTab.paginationText()
.then((el) => {
expect(el.trim()).to.eq(`${ count - (count % 10) + 1 } - ${ count } of ${ count } GlobalRoles`);
expect(el.trim()).to.eq(`${ count - (lastPageCount) + 1 } - ${ count } of ${ count } GlobalRoles`);
});

// navigate to first page - beginning button
Expand Down
9 changes: 8 additions & 1 deletion cypress/e2e/tests/pages/users-and-auth/users.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,18 @@ describe('Users', { tags: ['@usersAndAuths', '@adminUser'] }, () => {
.endButton()
.click();

// row count on last page
let lastPageCount = count % 10;

if (lastPageCount === 0) {
lastPageCount = 10;
}

// check text after navigation
usersPo.list().resourceTable().sortableTable().pagination()
.paginationText()
.then((el) => {
expect(el.trim()).to.eq(`${ count - (count % 10) + 1 } - ${ count } of ${ count } Users`);
expect(el.trim()).to.eq(`${ count - (lastPageCount) + 1 } - ${ count } of ${ count } Users`);
});

// navigate to first page - beginning button
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/tests/setup/rancher-setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { serverUrlLocalhostCases, urlWithTrailingForwardSlash, httpUrl, nonUrlCa

// Cypress or the GrepTags avoid to run multiples times the same test for each tag used.
// This is a temporary solution till initialization is not handled as a test
describe('Rancher setup', { tags: ['@adminUserSetup', '@standardUserSetup', '@setup', '@components', '@navigation', '@charts', '@explorer', '@extensions', '@fleet', '@generic', '@globalSettings', '@manager', '@userMenu', '@usersAndAuths', '@elemental', '@vai'] }, () => {
describe('Rancher setup', { tags: ['@adminUserSetup', '@standardUserSetup', '@setup', '@components', '@navigation', '@charts', '@explorer', '@explorer2', '@extensions', '@fleet', '@generic', '@globalSettings', '@manager', '@userMenu', '@usersAndAuths', '@elemental', '@vai'] }, () => {
const rancherSetupLoginPage = new RancherSetupLoginPagePo();
const rancherSetupConfigurePage = new RancherSetupConfigurePage();
const homePage = new HomePagePo();
Expand Down

0 comments on commit 76ee305

Please sign in to comment.