diff --git a/cypress/e2e/multi-lang-phrase.cy.js b/cypress/e2e/multi-lang-phrase.cy.js new file mode 100644 index 0000000..173bc5b --- /dev/null +++ b/cypress/e2e/multi-lang-phrase.cy.js @@ -0,0 +1,37 @@ +describe('Foreign language phrase search', () => { + // See #6 + // Thematische Suche#L30 + it('en all fields query matches en not ar', () => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Egyptian Language', + type: 'AllFields' + } + }) + cy.get('.resultlist') + // PPN JST063665204 + .contains('The Egyptian Language') + cy.get('.resultlist') + // PPN DOAJ008736839 + .should('not.contain', 'المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') + + }) + + it('en subject query matches en and ar', () => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Egyptian Language', + type: 'Subject' + } + }) + cy.get('.resultlist') + // PPN JST063665204 + .contains('The Egyptian Language') + cy.get('.resultlist') + // PPN DOAJ008736839 + .contains('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') + + }) +}) \ No newline at end of file diff --git a/cypress/e2e/nested.cy.js b/cypress/e2e/nested.cy.js new file mode 100644 index 0000000..f7aafc7 --- /dev/null +++ b/cypress/e2e/nested.cy.js @@ -0,0 +1,27 @@ +describe('Parent Work', () => { + // see #8 + 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(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'African American Review', + type: 'Title', + "filter[]": '~remote_bool:"false"' + } + }) + }) + + it('should appear before child work', () => { + cy.get('#result0') + .find('.media-type') + .contains(' Zeitschrift (gedruckt) ') + cy.get('#result1') + .find('.media-type') + .contains(' Band einer Zeitschrift/Zeitung ') + }) + }) +}) \ No newline at end of file diff --git a/cypress/e2e/reviews.cy.js b/cypress/e2e/reviews.cy.js index f7ae92e..51d32e3 100644 --- a/cypress/e2e/reviews.cy.js +++ b/cypress/e2e/reviews.cy.js @@ -1,7 +1,6 @@ -// see #12 - - describe('Review after reviewed', () => { + // see #12 + // we should add more language specific searches here describe('36 Strategems', () => { beforeEach(() => { cy.visit({ @@ -17,7 +16,7 @@ describe('Review after reviewed', () => { // affirm existent of primary work title via PP it('should be among top 5 hits', () => { cy.get('[href*="020460147"]') - .should('exist') + .should('exist') }) // TODO(DP): unskip after yaml changes @@ -30,7 +29,7 @@ describe('Review after reviewed', () => { }) describe('Liberty manik', () => { - // Note Title search 20 hits, AllFields (23) but all fields tested above + // Note Title search 20 hits, AllFields (23) but allfields already tested above beforeEach(() => { cy.visit({ url: '/Results', @@ -44,9 +43,9 @@ describe('Review after reviewed', () => { // TODO(DP): unclear what the top hit should be it('should see matching search results', () => { cy.get('[href*="1019346698"]') - .should('exist') + .should('exist') }) - + // TODO(DP): unskip after yaml changes it.skip('first hit should not be a review', () => { cy.get('#result0') diff --git a/cypress/e2e/simple.cy.js b/cypress/e2e/simple.cy.js index 80b08ea..69588b1 100644 --- a/cypress/e2e/simple.cy.js +++ b/cypress/e2e/simple.cy.js @@ -29,67 +29,4 @@ describe('simple GUI spec', () => { }) }) - - describe('Foreign language phrase search', () => { - // See #6 - // Thematische Suche#L30 - it('en all fields query matches en not ar', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'Egyptian Language', - type: 'AllFields' - } - }) - cy.get('.resultlist') - // PPN JST063665204 - .contains('The Egyptian Language') - cy.get('.resultlist') - // PPN DOAJ008736839 - .should('not.contain', 'المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') - - }) - - it('en subject query matches en and ar', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'Egyptian Language', - type: 'Subject' - } - }) - cy.get('.resultlist') - // PPN JST063665204 - .contains('The Egyptian Language') - cy.get('.resultlist') - // PPN DOAJ008736839 - .contains('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') - - }) - }) - - // see #8 - // 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 - // - describe('Parent Work', () => { - it('should appear before child work', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'African American Review', - type: 'Title', - "filter[]": '~remote_bool:"false"' - } - }) - cy.get('#result0') - .find('.media-type') - .contains(' Zeitschrift (gedruckt) ') - cy.get('#result1') - .find('.media-type') - .contains(' Band einer Zeitschrift/Zeitung ') - - }) - }) }) \ No newline at end of file