chore: colocate ui tests

UI tests can now be colocated where they make more sense.
The filename must start with ui_test_ and end with .js to be
picked up by cypress.
This commit is contained in:
Faris Ansari 2022-01-03 16:18:43 +05:30
parent b73ed8ffbc
commit f7e8135a0c
2 changed files with 5 additions and 3 deletions

View file

@ -9,5 +9,7 @@
"retries": {
"runMode": 2,
"openMode": 2
}
},
"integrationFolder": ".",
"testFiles": ["cypress/integration/*.js", "**/ui_test_*.js"]
}

View file

@ -30,7 +30,7 @@ Cypress.Commands.add('login', (email, password) => {
email = 'Administrator';
}
if (!password) {
password = Cypress.config('adminPassword');
password = Cypress.env('adminPassword');
}
cy.request({
url: '/api/method/login',
@ -161,7 +161,7 @@ Cypress.Commands.add('remove_doc', (doctype, name) => {
Cypress.Commands.add('create_records', doc => {
return cy
.call('frappe.tests.ui_test_helpers.create_if_not_exists', {doc})
.call('frappe.tests.ui_test_helpers.create_if_not_exists', {doc: JSON.stringify(doc)})
.then(r => r.message);
});