Bugzilla – Attachment 148429 Details for
Bug 33282
Cypress tests are failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33282: Move get_title to index.js to be invoked by different specs
Bug-33282-Move-gettitle-to-indexjs-to-be-invoked-b.patch (text/plain), 6.54 KB, created by
Pedro Amorim
on 2023-03-20 18:25:59 UTC
(
hide
)
Description:
Bug 33282: Move get_title to index.js to be invoked by different specs
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-03-20 18:25:59 UTC
Size:
6.54 KB
patch
obsolete
>From 89bc1a017788c69ed1a1915401cc3d9326fcac35 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 20 Mar 2023 17:19:53 -0100 >Subject: [PATCH] Bug 33282: Move get_title to index.js to be invoked by > different specs > >--- > t/cypress/integration/Titles_spec.ts | 61 +++------------------------- > t/cypress/support/index.js | 49 ++++++++++++++++++++++ > 2 files changed, 55 insertions(+), 55 deletions(-) > >diff --git a/t/cypress/integration/Titles_spec.ts b/t/cypress/integration/Titles_spec.ts >index 2f30eda721..90061e600d 100644 >--- a/t/cypress/integration/Titles_spec.ts >+++ b/t/cypress/integration/Titles_spec.ts >@@ -2,55 +2,6 @@ import { mount } from "@cypress/vue"; > const dayjs = require("dayjs"); /* Cannot use our calendar JS code, it's in an include file (!) > Also note that moment.js is deprecated */ > >-function get_title() { >- return { >- access_type: "access type", >- biblio_id: null, >- coverage_depth: "coverage depth", >- date_first_issue_online: "date first", >- date_last_issue_online: "date last", >- date_monograph_published_online: "date mono online", >- date_monograph_published_print: "date mono print", >- embargo_info: "embargo info", >- external_id: "", >- first_author: "first author", >- first_editor: "first editor", >- monograph_edition: "monograph edition", >- monograph_volume: "monograph volume", >- notes: "notes", >- num_first_issue_online: "num first issue", >- num_first_vol_online: "num first vol", >- num_last_issue_online: "num last issue", >- num_last_vol_online: "num last vol", >- online_identifier: "online identifier", >- parent_publication_title_id: "parent id", >- preceeding_publication_title_id: "preceeding id", >- print_identifier: "print identifier", >- publication_title: "publication title", >- publication_type: "journal", >- publisher_name: "publication name", >- resources: [ >- { >- ended_on: null, >- package: { >- content_type: "", >- package_id: 1, >- name: "first package name" >- }, >- package_id: 1, >- resource_id: 2, >- title: { >- biblio_id: 439, >- title_id: 1, >- }, >- title_id: 1 >- } >- ], >- title_id: 1, >- title_url: "title url" >- }; >-} >- > function get_packages_to_relate() { > return [ > { >@@ -82,7 +33,7 @@ describe("Title CRUD operations", () => { > }); > > it("Import titles", () => { >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > let resource = erm_title.resources[0]; > > // Create a list in case none exists >@@ -146,7 +97,7 @@ describe("Title CRUD operations", () => { > cy.get("#titles_list").contains("There are no titles defined"); > > // GET titles returns something >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > let titles = [erm_title]; > > cy.intercept("GET", "/api/v1/erm/eholdings/local/titles*", { >@@ -179,7 +130,7 @@ describe("Title CRUD operations", () => { > cy.get("#titles_add h2").contains("New title"); > > // Fill in the form for normal attributes >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > > cy.get("#titles_add").contains("Submit").click(); > cy.get("input:invalid,textarea:invalid,select:invalid").should( >@@ -252,7 +203,7 @@ describe("Title CRUD operations", () => { > }); > > it("Edit title", () => { >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > let titles = [erm_title]; > // Click the 'Edit' button from the list > cy.intercept("GET", "/api/v1/erm/eholdings/local/titles*", { >@@ -329,7 +280,7 @@ describe("Title CRUD operations", () => { > }); > > it("Show title", () => { >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > let titles = [erm_title]; > // Click the "name" link from the list > cy.intercept("GET", "/api/v1/erm/eholdings/local/titles*", { >@@ -401,7 +352,7 @@ describe("Title CRUD operations", () => { > }); > > it("Delete title", () => { >- let erm_title = get_title(); >+ let erm_title = cy.get_title(); > let titles = [erm_title]; > > // Click the 'Delete' button from the list >diff --git a/t/cypress/support/index.js b/t/cypress/support/index.js >index fd5bfb64f4..5ced7d5f02 100644 >--- a/t/cypress/support/index.js >+++ b/t/cypress/support/index.js >@@ -19,6 +19,55 @@ import './commands'; > // Alternatively you can use CommonJS syntax: > // require('./commands') > >+cy.get_title = () => { >+ return { >+ access_type: "access type", >+ biblio_id: null, >+ coverage_depth: "coverage depth", >+ date_first_issue_online: "date first", >+ date_last_issue_online: "date last", >+ date_monograph_published_online: "date mono online", >+ date_monograph_published_print: "date mono print", >+ embargo_info: "embargo info", >+ external_id: "", >+ first_author: "first author", >+ first_editor: "first editor", >+ monograph_edition: "monograph edition", >+ monograph_volume: "monograph volume", >+ notes: "notes", >+ num_first_issue_online: "num first issue", >+ num_first_vol_online: "num first vol", >+ num_last_issue_online: "num last issue", >+ num_last_vol_online: "num last vol", >+ online_identifier: "online identifier", >+ parent_publication_title_id: "parent id", >+ preceeding_publication_title_id: "preceeding id", >+ print_identifier: "print identifier", >+ publication_title: "publication title", >+ publication_type: "journal", >+ publisher_name: "publication name", >+ resources: [ >+ { >+ ended_on: null, >+ package: { >+ content_type: "", >+ package_id: 1, >+ name: "first package name" >+ }, >+ package_id: 1, >+ resource_id: 2, >+ title: { >+ biblio_id: 439, >+ title_id: 1, >+ }, >+ title_id: 1 >+ } >+ ], >+ title_id: 1, >+ title_url: "title url" >+ }; >+} >+ > cy.get_agreements_to_relate = () => { > return [ > { >-- >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 33282
:
148427
|
148428
|
148429
|
148430
|
148509
|
148510
|
148511
|
148512
|
148631