Bugzilla – Attachment 157762 Details for
Bug 32607
Add record sources CRUD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32607: Add cypress tests
Bug-32607-Add-cypress-tests.patch (text/plain), 3.46 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-10-24 19:48:59 UTC
(
hide
)
Description:
Bug 32607: Add cypress tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-10-24 19:48:59 UTC
Size:
3.46 KB
patch
obsolete
>From 7161a79effb3a6ebf346c2329766b04bfff13027 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 24 Oct 2023 16:47:47 -0300 >Subject: [PATCH] Bug 32607: Add cypress tests > >--- > t/cypress/integration/RecordSources_spec.ts | 82 +++++++++++++++++++++ > 1 file changed, 82 insertions(+) > create mode 100644 t/cypress/integration/RecordSources_spec.ts > >diff --git a/t/cypress/integration/RecordSources_spec.ts b/t/cypress/integration/RecordSources_spec.ts >new file mode 100644 >index 00000000000..4acd0687aab >--- /dev/null >+++ b/t/cypress/integration/RecordSources_spec.ts >@@ -0,0 +1,82 @@ >+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 */ >+ >+describe("Breadcrumbs tests", () => { >+ >+ beforeEach(() => { >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ }); >+ >+ it("Breadcrumbs", () => { >+ >+ cy.visit("/cgi-bin/koha/admin/admin-home.pl"); >+ cy.contains("Record sources").click(); >+ cy.get("#breadcrumbs").contains("Administration"); >+ cy.get(".item-last").contains("Record sources"); >+ // use the 'New' button >+ cy.contains("New record source").click(); >+ cy.wait(500); >+ cy.get(".item-last").contains("Add record source"); >+ cy.get("#breadcrumbs").contains("Record sources") >+ .should("have.attr","href") >+ .and("equal", "/cgi-bin/koha/admin/record-sources"); >+ }); >+}); >+ >+describe("Record sources CRUD tests", () => { >+ >+ beforeEach(() => { >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ }); >+ >+ it("Add", () => { >+ >+ cy.visit("/cgi-bin/koha/admin/admin-home.pl"); >+ cy.contains("Record sources").click(); >+ // use the 'New' button >+ cy.contains("New record source").click(); >+ // fill the form >+ cy.get("#name").type("Poop"); >+ // there's no (and there will be no) way to interact with the pop-up window >+ // FIXME: Is this a good reason to move this to a modal? >+ // https://docs.cypress.io/guides/references/trade-offs#Permanent-trade-offs >+ cy.get("#selected_patron_id").type("1", { force: true }); >+ >+ // Submit the form, get 500 >+ cy.intercept("POST", "/api/v1/record_sources", { >+ statusCode: 500, >+ error: "Something went wrong", >+ }); >+ cy.get("#record_source_edit").contains("Submit").click(); >+ cy.get("main div[class='dialog alert']").contains( >+ "Something went wrong: SyntaxError: Unexpected end of JSON input" >+ ); >+ }); >+ >+ it("Edit", () => { >+ >+ cy.visit("/cgi-bin/koha/admin/admin-home.pl"); >+ cy.contains("Record sources").click(); >+ cy.get("#breadcrumbs").contains("Administration"); >+ cy.get(".item-last").contains("Record sources"); >+ }); >+ >+ it("List", () => { >+ >+ cy.visit("/cgi-bin/koha/admin/admin-home.pl"); >+ cy.contains("Record sources").click(); >+ cy.get("#breadcrumbs").contains("Administration"); >+ cy.get(".item-last").contains("Record sources"); >+ }); >+ >+ it("Delete", () => { >+ >+ cy.visit("/cgi-bin/koha/admin/admin-home.pl"); >+ cy.contains("Record sources").click(); >+ cy.get("#breadcrumbs").contains("Administration"); >+ cy.get(".item-last").contains("Record sources"); >+ }); >+}); >-- >2.42.0
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 32607
:
146410
|
146411
|
146412
|
149777
|
149827
|
149828
|
149829
|
154006
|
154007
|
154008
|
154009
|
154010
|
154438
|
155682
|
155683
|
155684
|
155685
|
155686
|
155958
|
157756
|
157757
|
157758
|
157759
|
157760
|
157761
|
157762
|
161362
|
161363
|
161364
|
161365
|
161366
|
161367
|
161435
|
161436
|
161437
|
161438
|
161439
|
161440
|
161441
|
161474