Bugzilla – Attachment 154794 Details for
Bug 34217
Add missing cypress tests for vendors in agreements and licenses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34217: Add vendor tests for licenses
Bug-34217-Add-vendor-tests-for-licenses.patch (text/plain), 2.82 KB, created by
Pedro Amorim
on 2023-08-25 10:20:44 UTC
(
hide
)
Description:
Bug 34217: Add vendor tests for licenses
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-25 10:20:44 UTC
Size:
2.82 KB
patch
obsolete
>From 725de0147cc371d280081910857487f25616906a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 25 Aug 2023 10:20:14 +0000 >Subject: [PATCH] Bug 34217: Add vendor tests for licenses > >--- > t/cypress/integration/ERM/Licenses_spec.ts | 30 ++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > >diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts >index c296091c1c..023316ba9c 100644 >--- a/t/cypress/integration/ERM/Licenses_spec.ts >+++ b/t/cypress/integration/ERM/Licenses_spec.ts >@@ -18,6 +18,8 @@ function get_license() { > started_on: dates["today_iso"], > ended_on: dates["tomorrow_iso"], > user_roles: [], >+ vendor_id: 1, >+ vendor: [cy.get_vendors_to_relate()[0]], > documents: [ > { > license_id: 1, >@@ -85,6 +87,7 @@ describe("License CRUD operations", () => { > > // Fill in the form for normal attributes > let license = get_license(); >+ let vendors = cy.get_vendors_to_relate(); > > cy.get("#licenses_add").contains("Submit").click(); > cy.get("input:invalid,textarea:invalid,select:invalid").should( >@@ -101,6 +104,15 @@ describe("License CRUD operations", () => { > force: true, > }); > >+ // vendors >+ cy.get("#license_vendor_id .vs__selected").should("not.exist"); //no vendor pre-selected for new license >+ >+ cy.get("#license_vendor_id .vs__search").type( >+ vendors[0].name + "{enter}", >+ { force: true } >+ ); >+ cy.get("#license_vendor_id .vs__selected").contains(vendors[0].name); >+ > cy.get("#started_on+input").click(); > cy.get(".flatpickr-calendar") > .eq(0) >@@ -152,6 +164,14 @@ describe("License CRUD operations", () => { > it("Edit license", () => { > let license = get_license(); > let licenses = [license]; >+ let vendors = cy.get_vendors_to_relate(); >+ >+ // Intercept vendors request >+ cy.intercept("GET", "/api/v1/acquisitions/vendors?_per_page=-1", { >+ statusCode: 200, >+ body: vendors, >+ }).as("get-vendor-options"); >+ > // Click the 'Edit' button from the list > cy.intercept("GET", "/api/v1/erm/licenses*", { > statusCode: 200, >@@ -172,6 +192,16 @@ describe("License CRUD operations", () => { > > // Form has been correctly filled in > cy.get("#license_name").should("have.value", license.name); >+ >+ cy.get("#license_vendor_id .vs__selected").contains( >+ license.vendor[0].name >+ ); >+ >+ cy.get("#license_vendor_id .vs__search").type( >+ vendors[1].name + "{enter}", >+ { force: true } >+ ); >+ > cy.get("#license_description").should( > "have.value", > license.description >-- >2.30.2
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 34217
:
153088
|
153266
|
153722
|
154794
|
154996
|
154997
|
154998
|
155257
|
155258
|
155259
|
155260