Skip to content

Commit b54cbb2

Browse files
author
Raphael Kabo
committed
run Cypress tests using Okta
1 parent b58112d commit b54cbb2

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

cypress.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ export default defineConfig({
2626
e2e: {
2727
specPattern: 'cypress/tests/**/*.cy.{js,jsx,ts,tsx}',
2828
setupNodeEvents(on, config) {
29+
on('task', {
30+
log(message) {
31+
console.log(message);
32+
33+
return null;
34+
},
35+
});
2936
return require('./cypress/plugins/index.ts')(on, config);
3037
},
3138
baseUrl: 'https://manage.thegulocal.com',

cypress/support/commands.ts

+9
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ export const createTestUser = ({
133133
const finalEmail = primaryEmailAddress || randomMailosaurEmail();
134134
// Generate a random password if none is provided.
135135
const finalPassword = password || uuidv4();
136+
137+
console.log('Creating test user');
138+
cy.task(
139+
'log',
140+
'Creating test user ' +
141+
Cypress.env('IDAPI_CLIENT_ACCESS_TOKEN').slice(0, 1) +
142+
'*****',
143+
);
144+
136145
try {
137146
return cy
138147
.request({

server/oktaConfig.ts

+3
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@ export const getConfig = async (): Promise<OktaConfig> => {
3434
if (!isValidConfig(config)) {
3535
throw new Error('Error loading a valid config');
3636
}
37+
if (process.env.RUNNING_IN_CYPRESS === 'true') {
38+
config.useOkta = true;
39+
}
3740
return config;
3841
};

0 commit comments

Comments
 (0)