Skip to content
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
5 changes: 3 additions & 2 deletions cypress/e2e/po/components/resource-table.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ export default class ResourceTablePo extends ComponentPo {
/**
* Navigates to the detail page for a given resource name
* @param name
* @param selector
* @returns
*/
goToDetailsPage(name: string) {
return this.sortableTable().detailsPageLinkWithName(name)
goToDetailsPage(name: string, selector?: string) {
return this.sortableTable().detailsPageLinkWithName(name, selector)
.click();
}
}
4 changes: 2 additions & 2 deletions cypress/e2e/po/components/sortable-table.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default class SortableTablePo extends ComponentPo {
/**
* Returns the link for resource details for a table row with a given name
*/
detailsPageLinkWithName(name: string) {
return this.rowElementWithName(name).find('td.col-link-detail a');
detailsPageLinkWithName(name: string, selector = 'td.col-link-detail a') {
return this.rowElementWithName(name).find(selector);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/po/pages/base/base-list-page.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export abstract class BaseListPagePo extends PagePo {
/**
* Navigates to the detail page for a given resource name
* @param name
* @param selector
* @returns
*/
goToDetailsPage(name: string) {
return this.baseResourceList().resourceTable().goToDetailsPage(name);
goToDetailsPage(name: string, selector?: string) {
return this.baseResourceList().resourceTable().goToDetailsPage(name, selector);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import PagePo from '@/cypress/e2e/po/pages/page.po';
import { BaseListPagePo } from '@/cypress/e2e/po/pages/base/base-list-page.po';
import ProvClusterListPo from '@/cypress/e2e/po/lists/provisioning.cattle.io.cluster.po';
import BurgerMenuPo from '@/cypress/e2e/po/side-bars/burger-side-menu.po';

/**
* List page for provisioning.cattle.io.cluster resources
*/
export default class ClusterManagerListPagePo extends PagePo {
export default class ClusterManagerListPagePo extends BaseListPagePo {
private static createPath(clusterId: string) {
return `/c/${ clusterId }/manager/provisioning.cattle.io.cluster`;
}
Expand Down Expand Up @@ -63,8 +63,4 @@ export default class ClusterManagerListPagePo extends PagePo {
editCluster(name: string) {
this.sortableTable().rowActionMenuOpen(name).getMenuItem('Edit Config').click();
}

clickOnClusterName(name: string) {
this.sortableTable().rowWithClusterName(name).click();
}
}
10 changes: 5 additions & 5 deletions cypress/e2e/tests/pages/manager/cluster-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
const clusterList = new ClusterManagerListPagePo('_');

clusterList.waitForPage();
clusterList.clickOnClusterName('local');
clusterList.list().resourceTable().sortableTable().filter('local', 100);
clusterList.waitForPage('q=local');
clusterList.goToDetailsPage('local', '.cluster-link a');
clusterDetail.waitForPage();
});

it('can navigate to Cluster Conditions Page', () => {
Expand Down Expand Up @@ -587,7 +590,6 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
});

it(`Show Configuration allows to edit config and view yaml for local cluster`, () => {
clusterDetail.waitForPage();
clusterDetail.openShowConfiguration();
const drawer = clusterDetail.detailDrawer();

Expand All @@ -605,8 +607,6 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
});

it('can navigate to namespace from cluster detail view', () => {
clusterDetail.waitForPage();

clusterDetail.namespace().should('contain.text', 'fleet-local');
clusterDetail.namespace().click();

Expand Down Expand Up @@ -826,7 +826,7 @@ describe('Cluster Manager as standard user', { testIsolation: 'off', tags: ['@ma
const clusterList = new ClusterManagerListPagePo('_');

clusterList.waitForPage();
clusterList.clickOnClusterName('local');
clusterList.goToDetailsPage('local', '.cluster-link a');
});

it(`Show Configuration allows to view but not edit config and yaml for local cluster`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ describe('Deploy RKE2 cluster using node driver on Amazon EC2', { testIsolation:
// check cluster details page > recent events
ClusterManagerListPagePo.navTo();
clusterList.waitForPage();
clusterList.clickOnClusterName(this.rke2Ec2ClusterName);
clusterList.goToDetailsPage(this.rke2Ec2ClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-events"]');
clusterDetails.waitForPage(null, 'events');
clusterDetails.recentEventsList().checkTableIsEmpty();
});

Expand All @@ -167,9 +168,10 @@ describe('Deploy RKE2 cluster using node driver on Amazon EC2', { testIsolation:
// check cluster details page > snapshots
ClusterManagerListPagePo.navTo();
clusterList.waitForPage();
clusterList.clickOnClusterName(this.rke2Ec2ClusterName);
clusterList.goToDetailsPage(this.rke2Ec2ClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-snapshots"]');
clusterDetails.waitForPage(null, 'snapshots');
clusterDetails.snapshotsList().checkTableIsEmpty();

// create on demand snapshot
Expand All @@ -182,8 +184,10 @@ describe('Deploy RKE2 cluster using node driver on Amazon EC2', { testIsolation:
clusterList.list().state(this.rke2Ec2ClusterName).contains('Active', { timeout: 700000 });

// check snapshot exist
clusterList.clickOnClusterName(this.rke2Ec2ClusterName);
clusterList.goToDetailsPage(this.rke2Ec2ClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-snapshots"]');
clusterDetails.waitForPage(null, 'snapshots');
clusterDetails.snapshotsList().checkSnapshotExist(`on-demand-${ this.rke2Ec2ClusterName }`);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ describe('Deploy RKE2 cluster using node driver on Azure', { testIsolation: 'off
// check cluster details page > recent events
ClusterManagerListPagePo.navTo();
clusterList.waitForPage();
clusterList.clickOnClusterName(this.rke2AzureClusterName);
clusterList.goToDetailsPage(this.rke2AzureClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-events"]');
clusterDetails.waitForPage(null, 'events');
clusterDetails.recentEventsList().checkTableIsEmpty();
});

Expand All @@ -208,8 +210,10 @@ describe('Deploy RKE2 cluster using node driver on Azure', { testIsolation: 'off
// check cluster details page > snapshots
ClusterManagerListPagePo.navTo();
clusterList.waitForPage();
clusterList.clickOnClusterName(this.rke2AzureClusterName);
clusterList.goToDetailsPage(this.rke2AzureClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-snapshots"]');
clusterDetails.waitForPage(null, 'snapshots');
clusterDetails.snapshotsList().checkTableIsEmpty();

// create on demand snapshot
Expand All @@ -222,8 +226,10 @@ describe('Deploy RKE2 cluster using node driver on Azure', { testIsolation: 'off
clusterList.list().state(this.rke2AzureClusterName).contains('Active', { timeout: 700000 });

// check snapshot exist
clusterList.clickOnClusterName(this.rke2AzureClusterName);
clusterList.goToDetailsPage(this.rke2AzureClusterName, '.cluster-link a');
clusterDetails.waitForPage(null, 'machine-pools');
clusterDetails.selectTab(tabbedPo, '[data-testid="btn-snapshots"]');
clusterDetails.waitForPage(null, 'snapshots');
clusterDetails.snapshotsList().checkSnapshotExist(`on-demand-${ this.rke2AzureClusterName }`);
});

Expand Down