Skip to content

Commit 228e845

Browse files
committed
Update access token naming convention
1 parent de4b3dd commit 228e845

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.github/workflows/cypress_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
3535
# Run tests in the Chrome browser
3636
- name: Run Cypress tests
37+
env:
38+
CYPRESS_ACCESS_TOKEN: ${{ secrets.CYPRESS_ACCESS_TOKEN }}
3739
run: npm run test:chrome
3840
continue-on-error: true
39-
env:
40-
CYPRESS_access_token: ${{ secrets.CYPRESS_ACCESS_TOKEN }}
4141

4242
# Merge generated multiple JSON reports into a single index.json report file
4343
- name: Merge test results into one

cypress.env.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"access_token": ""
2+
"ACCESS_TOKEN": ""
33
}

cypress/e2e/test_crud.cy.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Create a new user', () => {
99
method: 'POST',
1010
url: '/public/v2/users',
1111
headers: {
12-
'authorization': 'Bearer ' + Cypress.env('access_token'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
12+
'authorization': 'Bearer ' + Cypress.env('ACCESS_TOKEN'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
1313
},
1414
body: {
1515
"name": userName,
@@ -36,7 +36,7 @@ describe('Get user details', () => {
3636
method: 'GET',
3737
url: `/public/v2/users/${userId}`,
3838
headers: {
39-
'authorization': 'Bearer ' + Cypress.env('access_token'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
39+
'authorization': 'Bearer ' + Cypress.env('ACCESS_TOKEN'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
4040
}
4141
}).then((response) => {
4242
expect(response).to.have.property('status').to.equal(200)
@@ -55,7 +55,7 @@ describe('Update user details', () => {
5555
method: 'PUT',
5656
url: `/public/v2/users/${userId}`,
5757
headers: {
58-
'authorization': 'Bearer ' + Cypress.env('access_token'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
58+
'authorization': 'Bearer ' + Cypress.env('ACCESS_TOKEN'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
5959
},
6060
body: {
6161
"name": "Updated Name",
@@ -80,7 +80,7 @@ describe('Delete user', () => {
8080
method: 'DELETE',
8181
url: `/public/v2/users/${userId}`,
8282
headers: {
83-
'authorization': 'Bearer ' + Cypress.env('access_token'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
83+
'authorization': 'Bearer ' + Cypress.env('ACCESS_TOKEN'), // Generate access token from https://gorest.co.in/consumer/login and add the same to cypress.env.json
8484
}
8585
}).then((response) => {
8686
expect(response).to.have.property('status').to.equal(204)

0 commit comments

Comments
 (0)