Skip to content

Commit 857867d

Browse files
committed
cleanup and additional config for specs
1 parent dfb706c commit 857867d

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

cypress.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = defineConfig({
1111
e2e: {
1212
baseUrl: 'http://localhost:3000',
1313
chromeWebSecurity: false,
14+
defaultCommandTimeout: 10000,
1415
setupNodeEvents(on, config) {
1516
config = dotenvFlowPlugin(config)
1617
config.env = {
@@ -21,12 +22,13 @@ module.exports = defineConfig({
2122
},
2223
},
2324
env: {
24-
TEST_SCIENTIST_USER: '[email protected]',
25-
TEST_SCIENTIST_PW: '!test1234',
26-
NEXT_PUBLIC_PROVIDER_NAME: process.env.NEXT_PUBLIC_PROVIDER_NAME,
25+
CYPRESS_SEARCH_QUERY: 'test',
2726
NEXT_PUBLIC_PROVIDER_ID: process.env.NEXT_PUBLIC_PROVIDER_ID,
27+
NEXT_PUBLIC_PROVIDER_NAME: process.env.NEXT_PUBLIC_PROVIDER_NAME,
2828
NEXT_PUBLIC_TOKEN: process.env.NEXT_PUBLIC_TOKEN,
29-
CYPRESS_SEARCH_QUERY: 'test',
29+
TEST_SCIENTIST_PW: '!test1234',
30+
TEST_SCIENTIST_USER: '[email protected]',
31+
TEST_SESSION_COOKIE: process.env.TEST_SESSION_COOKIE,
3032
},
3133
reporter: 'junit',
3234
reporterOptions: {

cypress/e2e/request.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ describe('Viewing one request', () => {
3535
before(() => {
3636
apiCalls['useOneRequest'] = {
3737
...apiCalls['useOneRequest'],
38+
data: undefined,
3839
error: {
3940
body: {
4041
message: 'Quote Group Not Found',
4142
},
4243
statusCode: 404,
4344
},
44-
requestURL: '/quote_groups/fake-uuid.json'
4545
}
4646
})
4747

cypress/support/commands.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { scientistApiBaseURL } from './e2e'
44
// source: https://github.com/nextauthjs/next-auth/discussions/2053#discussioncomment-1191016
55
Cypress.Commands.add('login', (username, password) => {
66
cy.session([username, password], () => {
7-
cy.intercept('/api/auth/session', { fixture: 'session.json' }).as('session')
7+
cy.intercept('/api/auth/session', { fixture: 'session.json' }).as('session')
88

9-
// Set the cookie for cypress.
10-
// It has to be a valid cookie so next-auth can decrypt it and confirm its validity.
11-
// This cookie also may need to be refreshed intermittently if it expires
12-
cy.setCookie('next-auth.session-token', Cypress.env('TEST_SESSION_COOKIE'))
9+
// Set the cookie for cypress.
10+
// It has to be a valid cookie so next-auth can decrypt it and confirm its validity.
11+
// This cookie also may need to be refreshed intermittently if it expires
12+
// TODO(alishaevn): https://github.com/scientist-softserv/webstore/issues/375
13+
cy.setCookie('next-auth.session-token', Cypress.env('TEST_SESSION_COOKIE'))
1314
})
1415
})
1516

0 commit comments

Comments
 (0)