From ecedae7a3064a1d192574a939c934edb50a577bd Mon Sep 17 00:00:00 2001 From: duncdrum Date: Mon, 8 Jan 2024 15:54:37 +0100 Subject: [PATCH] fix: add more examples see #8 #12 --- cypress/e2e/nested.cy.js | 60 +++++++++++++++++++++++++++++++++++++-- cypress/e2e/reviews.cy.js | 57 +++++++++++++++++++++++++++++++++++-- 2 files changed, 111 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/nested.cy.js b/cypress/e2e/nested.cy.js index f7aafc7..7ecce94 100644 --- a/cypress/e2e/nested.cy.js +++ b/cypress/e2e/nested.cy.js @@ -1,10 +1,10 @@ -describe('Parent Work', () => { +describe('Nested Work', () => { // see #8 - describe("African American Review", () => { + describe('African American Review', () => { // Title search and online access false to limit noise // check if exact match first list item is the journal parent and subsequent entries are child works // a more elaborate test would compare the value of '.record-number' within the same family - before(() => { + beforeEach(() => { cy.visit({ url: '/Results', qs: { @@ -24,4 +24,58 @@ describe('Parent Work', () => { .contains(' Band einer Zeitschrift/Zeitung ') }) }) + + describe('Nachrichten Organ Bergbau Hüttenbetrieb', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Nachrichten Organ Bergbau Hüttenbetrieb', + type: 'allFields' + } + }) + }) + + // (DP): 3 hits no child works as far as I can see + // PPN: 168000709 + it('first hit should be parent work', () => { + cy.get('[href*="168000709"]') + .should('exist') + }) + }) + + describe('Journal of Comparative Law 2021', () => { + // (DP): parent work not in top 20 + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Journal of Comparative Law 2021', + type: 'allFields' + } + }) + }) + + + // PPN: 1755480725 + it('first hit should be 2021 child work based on search term', () => { + cy.get('#result0') + .find('[href*="1755480725"]') + .should('exist') + }) + + // TODO(DP): failing is this desirable? + it('parent work should appear in initial results', () => { + cy.get('[href*="521689139"]') + .should('exist') + }) + + // This asssumes de default view + it('first hit should be child volume based on search term', () => { + cy.get('#result0') + .find('.media-type') + .should('contain', 'Band einer Zeitschrift/Zeitung') + .and('not.contain', 'Serial Volume') + }) + }) }) \ No newline at end of file diff --git a/cypress/e2e/reviews.cy.js b/cypress/e2e/reviews.cy.js index 51d32e3..b91d196 100644 --- a/cypress/e2e/reviews.cy.js +++ b/cypress/e2e/reviews.cy.js @@ -19,7 +19,7 @@ describe('Review after reviewed', () => { .should('exist') }) - // TODO(DP): unskip after yaml changes + // TODO(DP): failing it.skip('first hit should not be a review', () => { cy.get('#result0') .contains('Strategeme') @@ -46,8 +46,8 @@ describe('Review after reviewed', () => { .should('exist') }) - // TODO(DP): unskip after yaml changes - it.skip('first hit should not be a review', () => { + // TODO(DP): failing + it('first hit should not be a review', () => { cy.get('#result0') .contains('Manik') .should('not.contain', 'Rezension') @@ -55,4 +55,55 @@ describe('Review after reviewed', () => { }) }) + describe('Die Organisierte Welt Internationale Beziehungen und Organisationsforschung', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Die Organisierte Welt Internationale Beziehungen und Organisationsforschung', + type: 'AllFields' + } + }) + }) + + // PPN 608988723 + it('first hit matches Title', () => { + cy.get('#result0') + .find('[href*="608988723"]') + .should('exist') + }) + + it('second hit should be a review', () => { + cy.get('#result1') + .contains('Rezension') + }) + }) + + describe('Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press', + type: 'AllFields', + limit: '10' + } + }) + }) + + // PPN 315776242 + // TODO(DP): failing + it('first hit matches exact title', () => { + cy.get('#result0') + .find('[href*="315776242"]') + .should('exist') + }) + + it.only('second hit should be a review', () => { + cy.get('#result1') + .should('exist') + .contains('Review') + }) + }) + }) \ No newline at end of file