Vue 3: Fixed cancelling adding members returns to the wrong page (#11906)

This commit is contained in:
Evgeniya Vashkevich 2024-09-13 15:56:28 -07:00 committed by GitHub
parent ab2f0a6295
commit 2659c459d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 4 deletions

View File

@ -32,6 +32,10 @@ export default class ClusterProjectMembersPo extends PagePo {
return new AsyncButtonPo('[data-testid="form-save"]', this.self());
}
cancelCreateForm(): AsyncButtonPo {
return new AsyncButtonPo('[data-testid="form-cancel"]', this.self());
}
resourcesList() {
return new BaseResourceList(this.self());
}

View File

@ -1,5 +1,6 @@
import UsersPo from '@/cypress/e2e/po/pages/users-and-auth/users.po';
import ClusterProjectMembersPo from '@/cypress/e2e/po/pages/explorer/cluster-project-members.po';
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
const runTimestamp = +new Date();
const runPrefix = `e2e-test-${ runTimestamp }`;
@ -7,14 +8,14 @@ const runPrefix = `e2e-test-${ runTimestamp }`;
const username = `${ runPrefix }-cluster-proj-member`;
const standardPassword = 'standard-password';
describe.skip('[Vue3 Skip]: Cluster Project and Members', { tags: ['@explorer2', '@adminUser'] }, () => {
describe('Cluster Project and Members', { tags: ['@explorer2', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
it('Members added to both Cluster Membership should not show "Loading..." next to their names', () => {
const usersAdmin = new UsersPo('_');
const userCreate = usersAdmin.createEdit();
// this will login as admin
cy.login();
// create a standard user
usersAdmin.goTo();
usersAdmin.list().create();
@ -54,4 +55,16 @@ describe.skip('[Vue3 Skip]: Cluster Project and Members', { tags: ['@explorer2',
});
});
});
it('Clicking cancel should return to Cluster and Project members ', () => {
HomePagePo.goTo();
const clusterMembership = new ClusterProjectMembersPo('local', 'cluster-membership');
clusterMembership.navToClusterMenuEntry('local');
// if we do not wait for the cluster page to load, then we get the old side nav from Users & Authentication
clusterMembership.waitForPageWithSpecificUrl('/c/local/explorer');
clusterMembership.navToSideMenuEntryByLabel('Cluster and Project Members');
clusterMembership.triggerAddClusterOrProjectMemberAction();
clusterMembership.cancelCreateForm().click();
clusterMembership.waitForPageWithExactUrl();
});
});

View File

@ -12,6 +12,7 @@ export default {
CruResource,
Loading,
},
inheritAttrs: false,
mixins: [CreateEditView],
async fetch() {