From f7e8135a0cad87f08912dc61fc30f7d76d4c514b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 3 Jan 2022 16:18:43 +0530 Subject: [PATCH] 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. --- cypress.json | 4 +++- cypress/support/commands.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress.json b/cypress.json index ae4495cfa8..15f8f230fa 100644 --- a/cypress.json +++ b/cypress.json @@ -9,5 +9,7 @@ "retries": { "runMode": 2, "openMode": 2 - } + }, + "integrationFolder": ".", + "testFiles": ["cypress/integration/*.js", "**/ui_test_*.js"] } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 933f6a1758..4fe315c372 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -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); });