Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Jun 23, 2023
1 parent cb06e10 commit c024ae5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
5 changes: 0 additions & 5 deletions cypress/e2e/po/components/ember/ember-accordion.po.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import EmberComponentPo from '@/cypress/e2e/po/components/ember/ember-component.po';
import EmberFormMembersPo from '@/cypress/e2e/po/components/ember/ember-form-members.po';

export default class EmberAccordionPo extends EmberComponentPo {
private headerSelector: string;
Expand All @@ -15,10 +14,6 @@ export default class EmberAccordionPo extends EmberComponentPo {
this.header().click();
}

formMembers() {
return new EmberFormMembersPo('[data-testid="cru-cluster__members__form"]');
}

header() {
return cy.iFrame().find(this.headerSelector);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import ClusterManagerCreatePagePo from '@/cypress/e2e/po/edit/provisioning.cattl
import EmberInputPo from '@/cypress/e2e/po/components/ember/ember-input.po';
import ClusterManagerCreateRKE1PagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create-rke1.po';
import EmberAccordionPo from '@/cypress/e2e/po/components/ember/ember-accordion.po';
import EmberFormMembersPo from '~/cypress/e2e/po/components/ember/ember-form-members.po';

/**
* Create page for an RKE1 custom cluster
*/
export default class ClusterManagerCreateRke1CustomPagePo extends ClusterManagerCreateRKE1PagePo {
static url: string = `${ ClusterManagerCreatePagePo.url }/create?type=custom`
static url = `${ ClusterManagerCreatePagePo.url }/create?type=custom`
static goTo(): Cypress.Chainable<Cypress.AUTWindow> {
return PagePo.goTo(ClusterManagerCreateRke1CustomPagePo.url);
}
Expand All @@ -27,6 +28,10 @@ export default class ClusterManagerCreateRke1CustomPagePo extends ClusterManager
return new EmberAccordionPo('cru-cluster__members');
}

memberRolesFormMembers(): EmberFormMembersPo {
return new EmberFormMembersPo('[data-testid="cru-cluster__members__form"]') ;
}

// Roles Page

nodeCommand(): EmberAccordionPo {
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/tests/pages/cluster-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('Cluster Manager', () => {

const createClusterRKE1Page = new ClusterManagerCreateRke1CustomPagePo();

describe.only('RKE1 Custom', () => {
describe('RKE1 Custom', () => {
it('can create new cluster', () => {
clusterList.goTo();
clusterList.checkIsCurrentPage();
Expand Down Expand Up @@ -147,8 +147,8 @@ describe('Cluster Manager', () => {

createClusterRKE1Page.memberRoles().checkExists();
createClusterRKE1Page.memberRoles().expand();
createClusterRKE1Page.memberRoles().formMembers().addMember();
createClusterRKE1Page.memberRoles().formMembers().setNewMemberWithCustomRoles('admin', roles);
createClusterRKE1Page.memberRolesFormMembers().addMember();
createClusterRKE1Page.memberRolesFormMembers().setNewMemberWithCustomRoles('admin', roles);

cy.intercept('POST', '/v3/clusterroletemplatebinding').as('binding');

Expand Down
7 changes: 2 additions & 5 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ Cypress.Commands.add('keyboardControls', (triggerKeys: any = {}, count = 1) => {
});

Cypress.Commands.add('iFrame', () => {
// This creates a lot of entries in the cypress running bar...
// in theory adding `{ log: false }` should hide these ...
// it does not
return cy
.get('[data-testid="ember-iframe"]')
.its('0.contentDocument.body')
.get('[data-testid="ember-iframe"]', { log: false })
.its('0.contentDocument.body', { log: false })
.should('not.be.empty')
.then((body) => cy.wrap(body));
});

0 comments on commit c024ae5

Please sign in to comment.