Bugzilla – Attachment 164902 Details for
Bug 36607
Use test builder in cypress tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36607: [DO NOT PUSH] Test for the commands
Bug-36607-DO-NOT-PUSH-Test-for-the-commands.patch (text/plain), 3.28 KB, created by
Matt Blenkinsop
on 2024-04-16 10:03:28 UTC
(
hide
)
Description:
Bug 36607: [DO NOT PUSH] Test for the commands
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-04-16 10:03:28 UTC
Size:
3.28 KB
patch
obsolete
>From b597a5a300632202bea809fab9e7725d12ec3c87 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Tue, 16 Apr 2024 09:53:18 +0000 >Subject: [PATCH] Bug 36607: [DO NOT PUSH] Test for the commands > >cypress run --spec t/cypress/integration/DataTest_spec.ts >--- > t/cypress/integration/DataTest_spec.ts | 70 ++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > create mode 100644 t/cypress/integration/DataTest_spec.ts > >diff --git a/t/cypress/integration/DataTest_spec.ts b/t/cypress/integration/DataTest_spec.ts >new file mode 100644 >index 0000000000..a8b0223dba >--- /dev/null >+++ b/t/cypress/integration/DataTest_spec.ts >@@ -0,0 +1,70 @@ >+import { mount } from "@cypress/vue"; >+ >+describe("Test data", () => { >+ beforeEach(() => { >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ }); >+ >+ it("should create an object based on passed data", () => { >+ const testPatronData = { >+ firstname: "Cypress", >+ surname: "Test", >+ }; >+ >+ cy.buildObject("Koha::Patrons", testPatronData); >+ cy.query( >+ "SELECT firstname, surname FROM borrowers WHERE firstname=?", >+ "Cypress" >+ ).then(result => { >+ expect(result[0].surname).to.equal("Test"); >+ }); >+ cy.deleteDbRow("Koha::Patrons", testPatronData); >+ }); >+ >+ it("should create an object when no data values are passed", () => { >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(53); >+ }); >+ cy.buildObject("Koha::Patrons"); >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(54); >+ }); >+ cy.deleteDbRow("Koha::Patrons", null, 1); >+ }); >+ >+ it("should cleanup the new database rows when the 'numberofRows' parameter is passed", () => { >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(53); >+ }); >+ cy.buildObject("Koha::Patrons"); >+ cy.buildObject("Koha::Patrons"); >+ cy.buildObject("Koha::Patrons"); >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(56); >+ }); >+ cy.deleteDbRow("Koha::Patrons", null, 3); >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(53); >+ }); >+ }); >+ >+ it("should cleanup the new database rows when the 'deleteParameters' parameter is passed", () => { >+ const testPatronData = { >+ firstname: "Cypress", >+ surname: "Test", >+ }; >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(53); >+ }); >+ cy.buildObject("Koha::Patrons", testPatronData); >+ >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(54); >+ }); >+ cy.deleteDbRow("Koha::Patrons", testPatronData); >+ cy.query("SELECT COUNT(*) as count FROM borrowers").then(result => { >+ expect(result[0].count).to.equal(53); >+ }); >+ }); >+}); >-- >2.37.1 (Apple Git-137.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 36607
:
164899
|
164900
|
164901
| 164902 |
166180
|
166237