-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from duncdrum/feat-secondary-works
Feat secondary works
- Loading branch information
Showing
11 changed files
with
795 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
describe('Author Search', () => { | ||
// see #14 | ||
describe('glaser karin' , () => { | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: 'glaser karin', | ||
type: 'Author' | ||
} | ||
}) | ||
}) | ||
|
||
// erster Treffer von Autorin | ||
it('first hit should be by the author', () => { | ||
cy.get('#result0') | ||
.find('.resultlist-data') | ||
.contains('Karin Glaser') | ||
}) | ||
}) | ||
|
||
describe('阎连科', () => { | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: '阎连科', | ||
type: 'Author' | ||
} | ||
}) | ||
}) | ||
|
||
// see #22 | ||
it('CJK author search should return translations', () => { | ||
cy.get('.record-list') | ||
.contains('Yan, Lianke') | ||
}) | ||
}) | ||
|
||
describe('"Corte, Justine del"', () => { | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: '"Corte, Justine del"', | ||
type: 'allFields' | ||
} | ||
}) | ||
}) | ||
|
||
it('strict search should only contain works by that author', () => { | ||
cy.get('.resultlist-data') | ||
.should('have.length.gte', 3) | ||
.and('contain','Corte, Justine del') | ||
}) | ||
}) | ||
|
||
describe('Samuel Scheidt' , () => { | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: 'Samuel Scheidt', | ||
type: 'Author', | ||
limit: '5' | ||
} | ||
}) | ||
}) | ||
|
||
// (DP): 182 (or 90?)works by author but 200 hits. | ||
// within top 20 6 works unrelated to search 14 by author | ||
// Top 5 in author search should all be by author | ||
// see #28 | ||
it.skip('TOP 5 should all be by author', () => { | ||
cy.get('.resultlist-data') | ||
.find('[href*=Author]') | ||
.each(($el, index, $lis) => { | ||
cy.wrap($el) | ||
.contains('Scheidt, Samuel') | ||
}) | ||
.then(($lis) => { | ||
cy.wrap($lis) | ||
.should('have.length', '5') | ||
}) | ||
|
||
}) | ||
}) | ||
|
||
describe('oliver heaviside' , () => { | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: 'oliver heaviside', | ||
type: 'allFields' | ||
} | ||
}) | ||
}) | ||
|
||
it('should appear in each of top 20', () => { | ||
cy.get('.resultlist') | ||
.each(($el, index, $lis) => { | ||
cy.wrap($el) | ||
.contains('Heaviside', {matchCase: false}) | ||
}) | ||
.then(($lis) => { | ||
cy.wrap($lis) | ||
.should('have.length', '20') | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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', 'المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') | ||
|
||
}) | ||
|
||
// see #27 | ||
it.skip('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('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') | ||
|
||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
describe('Nested 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 | ||
beforeEach(() => { | ||
cy.visit({ | ||
url: '/Results', | ||
qs: { | ||
lookfor: 'African American Review', | ||
type: 'Title', | ||
"filter[]": '~remote_bool:"false"' | ||
} | ||
}) | ||
}) | ||
|
||
// see #25 | ||
it.skip('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 ') | ||
}) | ||
}) | ||
|
||
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') | ||
}) | ||
|
||
// see #25 | ||
it.skip('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') | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.