Bugzilla – Attachment 146957 Details for
Bug 32898
Cypress tests are failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32898: Avoid hardcoding user/pass in tests
Bug-32898-Avoid-hardcoding-userpass-in-tests.patch (text/plain), 3.78 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-02-20 14:08:01 UTC
(
hide
)
Description:
Bug 32898: Avoid hardcoding user/pass in tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-02-20 14:08:01 UTC
Size:
3.78 KB
patch
obsolete
>From c9c301be24fc1395b92ddb893c57fd9f72e842dc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 20 Feb 2023 11:07:44 -0300 >Subject: [PATCH] Bug 32898: Avoid hardcoding user/pass in tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/cypress/integration/Agreements_spec.ts | 2 +- > t/cypress/integration/Licenses_spec.ts | 2 +- > t/cypress/integration/Packages_spec.ts | 2 +- > t/cypress/integration/Titles_spec.ts | 2 +- > t/cypress/support/commands.js | 11 ++++++----- > 5 files changed, 10 insertions(+), 9 deletions(-) > >diff --git a/t/cypress/integration/Agreements_spec.ts b/t/cypress/integration/Agreements_spec.ts >index f562c40809c..62f666f2951 100644 >--- a/t/cypress/integration/Agreements_spec.ts >+++ b/t/cypress/integration/Agreements_spec.ts >@@ -123,7 +123,7 @@ describe("Agreement CRUD operations", () => { > }); > > beforeEach(() => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.title().should("eq", "Koha staff interface"); > }); > >diff --git a/t/cypress/integration/Licenses_spec.ts b/t/cypress/integration/Licenses_spec.ts >index 1a308a7163a..f825808138b 100644 >--- a/t/cypress/integration/Licenses_spec.ts >+++ b/t/cypress/integration/Licenses_spec.ts >@@ -39,7 +39,7 @@ describe("License CRUD operations", () => { > }); > > beforeEach(() => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.title().should("eq", "Koha staff interface"); > }); > >diff --git a/t/cypress/integration/Packages_spec.ts b/t/cypress/integration/Packages_spec.ts >index c368b79a1fe..48689e9a0e5 100644 >--- a/t/cypress/integration/Packages_spec.ts >+++ b/t/cypress/integration/Packages_spec.ts >@@ -30,7 +30,7 @@ describe("Package CRUD operations", () => { > }); > > beforeEach(() => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.title().should("eq", "Koha staff interface"); > }); > >diff --git a/t/cypress/integration/Titles_spec.ts b/t/cypress/integration/Titles_spec.ts >index bef33b78315..11fd825b29a 100644 >--- a/t/cypress/integration/Titles_spec.ts >+++ b/t/cypress/integration/Titles_spec.ts >@@ -73,7 +73,7 @@ describe("Title CRUD operations", () => { > }); > > beforeEach(() => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.title().should("eq", "Koha staff interface"); > }); > >diff --git a/t/cypress/support/commands.js b/t/cypress/support/commands.js >index a918c151592..cf101dd39c5 100644 >--- a/t/cypress/support/commands.js >+++ b/t/cypress/support/commands.js >@@ -24,11 +24,12 @@ > // -- This will overwrite an existing command -- > // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) > >- > Cypress.Commands.add('login', (username, password) => { >+ var user = typeof username === 'undefined' ? Cypress.env('KOHA_USER') : username; >+ var pass = typeof password === 'undefined' ? Cypress.env('KOHA_PASS') : password; > cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1') >- cy.get("#userid").type(username) >- cy.get("#password").type(password) >+ cy.get("#userid").type(user) >+ cy.get("#password").type(pass) > cy.get("#submit-button").click() > }) > >@@ -49,7 +50,7 @@ Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => { > }) > > Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.visit('/cgi-bin/koha/admin/admin-home.pl') > cy.get("h4").contains("Global system preferences").click(); > cy.get("a[title^=E-resource]").contains("E-resource management").click(); >@@ -59,6 +60,6 @@ Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => { > }) > > Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => { >- cy.login("koha", "koha"); >+ cy.login(); > cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value")); > }) >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32898
:
146343
|
146384
|
146385
|
146399
|
146643
|
146723
|
146724
|
146725
|
146957
|
146960
|
146961
|
146962
|
146963
|
146964