-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
1,186 additions
and
2,268 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// eslint-disable-next-line import/no-unused-modules | ||
const { defineConfig } = require('cypress') | ||
const webpack = require('@cypress/webpack-preprocessor') | ||
const preprocessor = require('@badeball/cypress-cucumber-preprocessor') | ||
|
||
/** | ||
* Configuration for the cypress-cucumber preprocessing, see: | ||
* https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples/webpack-cjs | ||
*/ | ||
async function setupNodeEvents(on, config) { | ||
// This is required for the preprocessor to be able to generate JSON reports after each run, and more, | ||
await preprocessor.addCucumberPreprocessorPlugin(on, config) | ||
|
||
on( | ||
'file:preprocessor', | ||
webpack({ | ||
webpackOptions: { | ||
resolve: { | ||
extensions: ['.ts', '.js'], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.feature$/, | ||
use: [ | ||
{ | ||
loader: '@badeball/cypress-cucumber-preprocessor/webpack', | ||
options: config, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
}) | ||
) | ||
|
||
// Make sure to return the config object as it might have been modified by the plugin. | ||
return config | ||
} | ||
|
||
module.exports = defineConfig({ | ||
projectId: 'sc56ms', | ||
video: false, | ||
e2e: { | ||
setupNodeEvents, | ||
baseUrl: 'http://localhost:3000', | ||
specPattern: 'cypress/e2e/**/*.feature', | ||
}, | ||
}) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"dhis2BaseUrl": "http://localhost:8080", | ||
"dhis2Username": "USERNAME_HERE", | ||
"dhis2Password": "PASSWORD_HERE" | ||
"LOGIN_NAME": "login name here", | ||
"LOGIN_PASSWORD": "password here", | ||
"LOGIN_SERVER": "https://debug.dhis2.org/dev" | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...gration/add-job/back-to-all-jobs/index.js → ...ess/e2e/add-job/back-to-all-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...on/add-job/create-parameter-jobs/index.js → ...2e/add-job/create-parameter-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...dd-job/create-parameterless-jobs/index.js → ...dd-job/create-parameterless-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...integration/add-job/cron-presets/index.js → cypress/e2e/add-job/cron-presets/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ss/integration/add-job/info-link/index.js → cypress/e2e/add-job/info-link/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ation/add-queue/back-to-all-jobs/index.js → ...s/e2e/add-queue/back-to-all-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...tegration/add-queue/create-queue/index.js → cypress/e2e/add-queue/create-queue/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ration/edit-job/back-to-all-jobs/index.js → ...ss/e2e/edit-job/back-to-all-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ntegration/edit-job/cron-presets/index.js → cypress/e2e/edit-job/cron-presets/index.js
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.
2 changes: 1 addition & 1 deletion
2
...tegration/edit-job/delete-button/index.js → cypress/e2e/edit-job/delete-button/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ntegration/edit-job/display-jobs/index.js → cypress/e2e/edit-job/display-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ion/edit-job/edit-parameter-jobs/index.js → ...e2e/edit-job/edit-parameter-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...edit-job/edit-parameterless-jobs/index.js → ...edit-job/edit-parameterless-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...s/integration/edit-job/info-link/index.js → cypress/e2e/edit-job/info-link/index.js
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.
2 changes: 1 addition & 1 deletion
2
...tion/edit-queue/back-to-all-jobs/index.js → .../e2e/edit-queue/back-to-all-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ntegration/edit-queue/edit-queue/index.js → cypress/e2e/edit-queue/edit-queue/index.js
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.
2 changes: 1 addition & 1 deletion
2
...s/integration/list/actions-queue/index.js → cypress/e2e/list/actions-queue/index.js
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.
2 changes: 1 addition & 1 deletion
2
...egration/list/actions-system-job/index.js → cypress/e2e/list/actions-system-job/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ntegration/list/actions-user-job/index.js → cypress/e2e/list/actions-user-job/index.js
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.
2 changes: 1 addition & 1 deletion
2
cypress/integration/list/filter/index.js → cypress/e2e/list/filter/index.js
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.
2 changes: 1 addition & 1 deletion
2
...gration/list/include-system-jobs/index.js → ...ess/e2e/list/include-system-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
cypress/integration/list/info-link/index.js → cypress/e2e/list/info-link/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ess/integration/list/list-queues/index.js → cypress/e2e/list/list-queues/index.js
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.
2 changes: 1 addition & 1 deletion
2
.../integration/list/list-user-jobs/index.js → cypress/e2e/list/list-user-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
cypress/integration/list/new-job/index.js → cypress/e2e/list/new-job/index.js
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.
2 changes: 1 addition & 1 deletion
2
cypress/integration/list/new-queue/index.js → cypress/e2e/list/new-queue/index.js
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.
2 changes: 1 addition & 1 deletion
2
cypress/integration/list/toggle-job/index.js → cypress/e2e/list/toggle-job/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ss/integration/list/toggle-queue/index.js → cypress/e2e/list/toggle-queue/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ot-authorized/block-unauthorized/index.js → ...ot-authorized/block-unauthorized/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ration/view-job/back-to-all-jobs/index.js → ...ss/e2e/view-job/back-to-all-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...ntegration/view-job/display-jobs/index.js → cypress/e2e/view-job/display-jobs/index.js
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.
2 changes: 1 addition & 1 deletion
2
...s/integration/view-job/info-link/index.js → cypress/e2e/view-job/info-link/index.js
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* global Cypress */ | ||
import '@testing-library/cypress/add-commands' | ||
|
||
/** | ||
* Custom login command, can be used to login or switch between sessions. | ||
* Will cache and restore cookies, localStorage, and sessionStorage. See: | ||
* https://docs.cypress.io/api/commands/session | ||
*/ | ||
Cypress.Commands.add('login', (user) => { | ||
cy.session( | ||
user, | ||
() => { | ||
// Login via API | ||
cy.request({ | ||
url: `${user.server}/dhis-web-commons-security/login.action`, | ||
method: 'POST', | ||
form: true, | ||
followRedirect: true, | ||
body: { | ||
j_username: user.name, | ||
j_password: user.password, | ||
'2fa_code': '', | ||
}, | ||
}) | ||
|
||
// Set base url for the app platform | ||
window.localStorage.setItem('DHIS2_BASE_URL', user.server) | ||
}, | ||
{ | ||
validate: () => { | ||
cy.request(`${user.server}/api/me`).then((response) => { | ||
expect(response.status).to.eq(200) | ||
expect(response.body.username).to.eq(user.name) | ||
}) | ||
}, | ||
} | ||
) | ||
}) | ||
|
||
// Log in before each test, if not already logged in | ||
beforeEach(() => { | ||
cy.login({ | ||
name: Cypress.env('LOGIN_NAME'), | ||
password: Cypress.env('LOGIN_PASSWORD'), | ||
server: Cypress.env('LOGIN_SERVER'), | ||
}) | ||
}) |
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
Oops, something went wrong.