Skip to content

Commit

Permalink
fix standard user tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Nov 1, 2024
1 parent 86759e1 commit f5beb84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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 @@ -109,6 +109,6 @@ describe('Rancher setup', { tags: ['@adminUserSetup', '@standardUserSetup', '@se
role: 'project-member',
},
password: Cypress.env('password')
});
}, { createNameOptions: { onlyContext: true } });
});
});
3 changes: 2 additions & 1 deletion cypress/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export type CreateAmazonRke2ClusterWithoutMachineConfigParams = {
}

export interface CreateResourceNameOptions {
prefixContext: boolean
onlyContext?: boolean
prefixContext?: boolean
}

declare global {
Expand Down
6 changes: 5 additions & 1 deletion cypress/support/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ Cypress.Commands.add('getRootE2EResourceName', () => {
/**
* Create resource name
*/
Cypress.Commands.add('createE2EResourceName', (context, options = { prefixContext: false }) => {
Cypress.Commands.add('createE2EResourceName', (context, options = { prefixContext: false, onlyContext: false }) => {
if (options?.onlyContext) {
return cy.wrap(context);
}

return cy.getRootE2EResourceName().then((root) => options?.prefixContext ? `${ context }-${ root }` : `${ root }-${ context }`);
});

Expand Down

0 comments on commit f5beb84

Please sign in to comment.