Skip to content

Commit

Permalink
refactor: split specs
Browse files Browse the repository at this point in the history
  • Loading branch information
duncdrum committed Jan 8, 2024
1 parent f536bbc commit 12a27c6
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 70 deletions.
37 changes: 37 additions & 0 deletions cypress/e2e/multi-lang-phrase.cy.js
Original file line number Diff line number Diff line change
@@ -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('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ')

})
})
27 changes: 27 additions & 0 deletions cypress/e2e/nested.cy.js
Original file line number Diff line number Diff line change
@@ -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 ')
})
})
})
13 changes: 6 additions & 7 deletions cypress/e2e/reviews.cy.js
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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
Expand All @@ -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',
Expand All @@ -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')
Expand Down
63 changes: 0 additions & 63 deletions cypress/e2e/simple.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ')

})
})
})

0 comments on commit 12a27c6

Please sign in to comment.