-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #803 from GSA/cypress-upgrade
Cypress upgrade
- Loading branch information
Showing
20 changed files
with
263 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const { defineConfig } = require('cypress') | ||
|
||
module.exports = defineConfig({ | ||
reporter: 'junit', | ||
reporterOptions: { | ||
mochaFile: 'cypress/results/output.xml', | ||
}, | ||
videoCompression: false, | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents(on, config) { | ||
return require('./cypress/plugins/index.js')(on, config) | ||
}, | ||
baseUrl: 'http://ckan:5000', | ||
specPattern: 'cypress/integration/*.cy.js', | ||
}, | ||
retries: { | ||
runMode: 2, | ||
openMode: 0, | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
describe('CKAN Token', () => { | ||
|
||
before(() => { | ||
cy.create_token(); | ||
}); | ||
|
||
after(() => { | ||
cy.revoke_token(); | ||
}); | ||
|
||
it('Can get CKAN token', () => { | ||
const token_data = Cypress.env('token_data'); | ||
expect(token_data.api_token).to.have.length(175); | ||
expect(token_data.jti).to.have.length(43); | ||
}); | ||
|
||
it('Can authorize with token', () => { | ||
const token_data = Cypress.env('token_data'); | ||
cy.logout(); | ||
|
||
// 403 without token | ||
cy.request({ | ||
method: 'GET', | ||
url: '/api/action/package_search', | ||
failOnStatusCode: false, | ||
}).then((response) => { | ||
expect(response.status).to.eq(403); | ||
}); | ||
|
||
// 200 with token | ||
cy.request({ | ||
method: 'GET', | ||
url: '/api/action/package_search', | ||
headers: { | ||
'Authorization': token_data.api_token | ||
} | ||
}).then((response) => { | ||
expect(response.status).to.eq(200); | ||
}); | ||
}); | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe('Main Page', () => { | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
|
||
it('Load main page with configuration', () => { | ||
cy.visit('/dataset'); | ||
cy.contains('Inventory'); | ||
}); | ||
|
||
}) |
Oops, something went wrong.