-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d3a32b
commit f9ac05d
Showing
5 changed files
with
263 additions
and
2 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
261 changes: 261 additions & 0 deletions
261
.../protocol-displayed-in-$0-of-manual-linked-field-without-$0-subfield-before-linking.cy.js
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,261 @@ | ||
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; | ||
import Permissions from '../../../../../support/dictionary/permissions'; | ||
import DataImport from '../../../../../support/fragments/data_import/dataImport'; | ||
import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; | ||
import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; | ||
import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; | ||
import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; | ||
import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; | ||
import TopMenu from '../../../../../support/fragments/topMenu'; | ||
import Users from '../../../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../../../support/utils/stringTools'; | ||
import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; | ||
|
||
describe('MARC', () => { | ||
describe('MARC Bibliographic', () => { | ||
describe('Edit MARC bib', () => { | ||
describe('Manual linking', () => { | ||
let userData = {}; | ||
|
||
const testData = { | ||
searchAuthorityQueries: [ | ||
'C436826 Whiteread, Rachel, 1963-', | ||
'C436826 Martini, Carlo Maria, 1927-2012. Works. Selections', | ||
'C436826 St. Louis Art Museum', | ||
'C436826 Tate Britain (Gallery)', | ||
'C436826 Action and adventure fiction', | ||
], | ||
subfieldZero: '$0', | ||
marcAuthIcon: 'Linked to MARC authority', | ||
}; | ||
|
||
const linkedTags = [ | ||
[ | ||
11, | ||
'100', | ||
'1', | ||
'\\', | ||
'$a C436826 Whiteread, Rachel, $d 1963-', | ||
'$e artist.', | ||
'$0 http://id.loc.gov/authorities/names/nr94042914', | ||
'', | ||
], | ||
[12, '240', '1', '0', '$a Works. $k Selections', '', '$0 2018019878', ''], | ||
[ | ||
24, | ||
'655', | ||
'\\', | ||
'7', | ||
'$a C436826 Action and adventure fiction', | ||
'', | ||
'$0 https://vocabularyserver.com/gsafd/gsafd2014026217', | ||
'$2 lcgft', | ||
], | ||
[ | ||
25, | ||
'710', | ||
'2', | ||
'\\', | ||
'$a C436826 Tate Britain (Gallery)', | ||
'$e organizer, $e host institution.', | ||
'$0 http://linking.com/automated/tests/protocolhttp/os000208089', | ||
'', | ||
], | ||
[ | ||
26, | ||
'710', | ||
'2', | ||
'\\', | ||
'$a C436826 St. Louis Art Museum', | ||
'$e host institution.', | ||
'$0 https://linking.com/automated/tests/protocolhttps/osw790055919', | ||
'', | ||
], | ||
]; | ||
|
||
const newMarcAuthoritySources = [ | ||
{ | ||
sourceName: `Test auth source file ${getRandomPostfix()}`, | ||
prefix: 'os', | ||
startWithNumber: '1', | ||
isChecked: false, | ||
baseUrl: 'http://linking.com/automated/tests/protocolhttp', | ||
}, | ||
{ | ||
sourceName: `Test auth source file ${getRandomPostfix()}`, | ||
prefix: 'osw', | ||
startWithNumber: '1', | ||
isChecked: false, | ||
baseUrl: 'https://linking.com/automated/tests/protocolhttps', | ||
}, | ||
]; | ||
|
||
const marcFiles = [ | ||
{ | ||
marc: 'marcBibFileForC436826.mrc', | ||
fileName: `testMarcFile.${getRandomPostfix()}.mrc`, | ||
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, | ||
numOfRecords: 1, | ||
propertyName: 'instance', | ||
}, | ||
{ | ||
marc: 'marcAuthFileForC436826.mrc', | ||
fileName: `testMarcFile.${getRandomPostfix()}.mrc`, | ||
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, | ||
numOfRecords: 5, | ||
propertyName: 'authority', | ||
}, | ||
]; | ||
|
||
const linkingTagAndValues = [ | ||
{ | ||
rowIndex: 11, | ||
value: 'C436826 Whiteread, Rachel, 1963-', | ||
tag: 100, | ||
}, | ||
{ | ||
rowIndex: 12, | ||
value: 'C436826 Martini, Carlo Maria 1927-2012. Works. Selections', | ||
tag: 240, | ||
}, | ||
{ | ||
rowIndex: 24, | ||
value: 'C436826 Action and adventure fiction', | ||
tag: 655, | ||
}, | ||
{ | ||
rowIndex: 25, | ||
value: 'C436826 Tate Britain (Gallery)', | ||
tag: 710, | ||
}, | ||
{ | ||
rowIndex: 26, | ||
value: 'C436826 St. Louis Art Museum', | ||
tag: 710, | ||
}, | ||
]; | ||
|
||
const createdRecordIDs = []; | ||
const createdAuthSources = []; | ||
|
||
before(() => { | ||
cy.createTempUser([ | ||
Permissions.inventoryAll.gui, | ||
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, | ||
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, | ||
Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, | ||
]).then((createdUserProperties) => { | ||
userData = createdUserProperties; | ||
|
||
testData.searchAuthorityQueries.forEach((query) => { | ||
MarcAuthorities.getMarcAuthoritiesViaApi({ | ||
limit: 100, | ||
query: `keyword="${query}" and (authRefType==("Authorized" or "Auth/Ref"))`, | ||
}).then((authorities) => { | ||
if (authorities) { | ||
authorities.forEach(({ id }) => { | ||
MarcAuthority.deleteViaAPI(id); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
newMarcAuthoritySources.forEach((source) => { | ||
cy.createAuthoritySourceFileUsingAPI( | ||
source.prefix, | ||
source.startWithNumber, | ||
source.sourceName, | ||
source.isChecked, | ||
source.baseUrl, | ||
// TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done | ||
true, | ||
).then((sourceId) => { | ||
createdAuthSources.push(sourceId); | ||
}); | ||
}); | ||
|
||
cy.getAdminToken(); | ||
marcFiles.forEach((marcFile) => { | ||
DataImport.uploadFileViaApi( | ||
marcFile.marc, | ||
marcFile.fileName, | ||
marcFile.jobProfileToRun, | ||
).then((response) => { | ||
response.forEach((record) => { | ||
createdRecordIDs.push(record[marcFile.propertyName].id); | ||
}); | ||
}); | ||
}); | ||
|
||
cy.login(userData.username, userData.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Deleting created users, Instances', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(userData.userId); | ||
createdRecordIDs.forEach((id, index) => { | ||
if (index) MarcAuthority.deleteViaAPI(id); | ||
else InventoryInstance.deleteInstanceViaApi(id); | ||
}); | ||
// TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done | ||
for (let i = 0; i < 2; i++) { | ||
cy.deleteAuthoritySourceFileViaAPI(createdAuthSources[i], true); | ||
} | ||
}); | ||
|
||
it( | ||
'C436826 Protocol is displayed in subfield "$0" of manually linked field when field has no subfield "$0" before linking (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire'] }, | ||
() => { | ||
InventoryInstances.searchByTitle(createdRecordIDs[0]); | ||
InventoryInstances.selectInstance(); | ||
|
||
InventoryInstance.editMarcBibliographicRecord(); | ||
QuickMarcEditor.checkPaneheaderContains('Edit MARC record'); | ||
QuickMarcEditor.checkValueAbsent(11, testData.subfieldZero); | ||
QuickMarcEditor.checkValueAbsent(12, testData.subfieldZero); | ||
QuickMarcEditor.checkValueAbsent(24, testData.subfieldZero); | ||
QuickMarcEditor.checkValueAbsent(25, testData.subfieldZero); | ||
QuickMarcEditor.checkValueAbsent(26, testData.subfieldZero); | ||
linkingTagAndValues.forEach((linking) => { | ||
QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); | ||
MarcAuthorities.switchToSearch(); | ||
InventoryInstance.verifySelectMarcAuthorityModal(); | ||
InventoryInstance.verifySearchOptions(); | ||
InventoryInstance.searchResults(linking.value); | ||
InventoryInstance.clickLinkButton(); | ||
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); | ||
}); | ||
|
||
linkedTags.forEach((field) => { | ||
QuickMarcEditor.verifyTagFieldAfterLinking(...field); | ||
}); | ||
QuickMarcEditor.pressSaveAndClose(); | ||
QuickMarcEditor.checkAfterSaveAndClose(); | ||
|
||
InventoryInstance.viewSource(); | ||
InventoryViewSource.contains( | ||
`${testData.marcAuthIcon}\n\t100\t1 \t$a C436826 Whiteread, Rachel, $d 1963- $e artist. $0 http://id.loc.gov/authorities/names/nr94042914 $9`, | ||
); | ||
InventoryViewSource.contains( | ||
`${testData.marcAuthIcon}\n\t240\t1 0\t$a Works. $k Selections $0 2018019878 $9`, | ||
); | ||
InventoryViewSource.contains( | ||
`${testData.marcAuthIcon}\n\t655\t 7\t$a C436826 Action and adventure fiction $0 https://vocabularyserver.com/gsafd/gsafd2014026217 $9`, | ||
); | ||
InventoryViewSource.contains( | ||
`${testData.marcAuthIcon}\n\t710\t2 \t$a C436826 Tate Britain (Gallery) $e organizer, $e host institution. $0 http://linking.com/automated/tests/protocolhttp/os000208089 $9`, | ||
); | ||
InventoryViewSource.contains( | ||
`${testData.marcAuthIcon}\n\t710\t2 \t$a C436826 St. Louis Art Museum $e host institution. $0 https://linking.com/automated/tests/protocolhttps/osw790055919 $9`, | ||
); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
01300cz a2200253n 4500001000800000005001700008008004100025010001700066035002300083040003900106046002100145100003800166370003400204372002000238373004600258374004600304375001900350377000800369670007600377670009000453670047900543953000901022985001501031126826720181211073550.0941216n| azannaabn n aaa c anr 94042914 a(OCoLC)oca03740903 aMH-FAbengerdacMH-FAdMH-FAdScU f1963-04-202edtf1 aC436826 Whiteread, Rachel,d1963- aIlford (London, England)2naf aSculpture2lcsh aSlade School of Fine Art2nafs1985t1987 aWomen sculptorsaSculptorsaArtists2lcsh aFemales2lcdgt aeng aRachel Whiteread, c1993:bp. 88 (b. 4/20/1963 London) p. 7 (sculptress) aLC database, 12/17/1994b(MLC hdg: Whiteread, Rachel, 1963-; usage: Rachel Whiteread) aThe Tate web site, December 7, 2018:b(Rachel Whiteread, born 1963 ; Rachel Whiteread, CBE (born 20 April 1963) is an English artist who primarily produces sculptures, which typically take the form of casts ; Whiteread was born in 1963 in Ilford. She was briefly at the Cyprus College of Art. From 1985 to 1987 she studied sculpture at Slade School of Art, University College, London, graduating with an MA in 1987)uhttps://www.tate.org.uk/art/artists/rachel-whiteread-2319 axx00 cRLINeLSPC00501cz a2200133n 4500001001100000005001700011008004100028035002300069040002700092100006600119400008900185430003100274670006200305201801987820180507073202.0180410n| azannaabn |a aaa a(OCoLC)oca11288544 aDLCbengerdacDLCdHU1 aC436826 Martini, Carlo Maria,d1927-2012.tWorks.kSelections1 aC436826 Martini, Carlo Maria,d1927-2012.tGiustizia, etica e politica nella città 0aC436826 Works.kSelections aGiustizia, etica e politica nella città, febbraio 2017.00992cz a2200253n 4500001000800000005001700008008004100025010001800066024006700084035002300151040004500174110003300219368002200252370002700274371005200301410004300353410003500396410005300431510005000484670005900534670012000593952001000713953001500723188470420220726125832.0790122n| azannaabn |a ana aosw790055919 7 a00000004046667822isni1https://isni.org/isni/0000000404666782 a(OCoLC)oca00239751 aDLCbengerdacDLCdNICdDLCdCMalGdDLC2 aC436826 St. Louis Art Museum aArt museums2lcsh eSaint Louis (Mo.)2naf a1 Fine Arts DrivebSaint LouiscMissourie631101 aC436826 Saint Louis (Mo.).bArt Museum2 aC436826 Saint Louis Art Museum1 aC436826 Saint Louis (Mo.).bSt. Louis Art Museum2 wriPredecessor:aCity Art Museum of St. Louis aBoston. Museum of Fine Arts. The Rathbone years, 1972. aSt. Louis Art Museum WWW site, viewed June 19, 2017b(St. Louis Art Museum, 1 Fine Arts Drive, St. Louis, MO 63110) aRETRO axx00bbe0603367cz a2200289n 4500001000800000005001700008008004100025010001700066035002300083040004500106046001800151110003500169368002200204370002600226510003400252510002600286510002700312510002500339667078400364670005801148670016901206670006401375670006201439670145101501675011002952953001503062513185520160520075503.0000627n| azannaabn |a ana c aos000208089 a(OCoLC)oca05252331 aICAbengerdacICAdUkOxUdICAdDLCdUPB s2000-032edtf2 aC436826 Tate Britain (Gallery) aArt museums2lcsh eLondon (England)2naf2 wriPredecessor:aTate Gallery2 aTate Modern (Gallery)2 aTate Gallery Liverpool2 aTate Gallery St Ives aSummary of Tate web sites, 03-03-01: "The Tate" houses the national collections of British art and of international modern art. Tate Modern, in London's former Bankside Power Station, displays international modern art from 1900 to the present day. Tate Britain, on Millbank, London (formerly the Tate Gallery), is the national gallery of British art from 1500 to the present. Tate Liverpool houses the national collection of modern art in the North of England. Tate St Ives, opened in Cornwall in 1993, also manages the Barbara Hepworth Museum and Sculpture Garden. The National Gallery contains Western European paintings from 1260 to 1900. In 1997 the Tate and National Galleries set the cut-off point between collections at 1900 and exchanged works from the other's time span. aRomantic landscape, c2000:bt.p. verso (Tate Britain) aTate WWW Home page, Jun. 27, 2000:bhome (the original Tate is now Tate Britain) news (Tate Britain at the original Millbank site in London will open Mar. 24, 2000) aRLIN, Jun. 27, 2000b(hdg.: Tate Britain (London, England)) aArtist and empire, 2015:bcolophon (Tate Britain, London) aWikipedia, May 18, 2016b(Tate Britain; Tate Britain (known from 1897 to 1932 as the National Gallery of British Art and from 1932 to 2000 as the Tate Gallery) is an art museum on Millbank in London; it is part of the Tate network of galleries in England, with Tate Modern, Tate Liverpool and Tate St Ives; it is the oldest gallery in the network, having opened in 1897; it houses a substantial collection of the art of the United Kingdom since Tudor times, and in particular has large holdings of the works of J. M. W. Turner, who bequeathed all his own collection to the nation. It is one of the largest museums in the country; the gallery is situated on Millbank, on the site of the former Millbank Prison; construction, undertaken by Higgs and Hill, commenced in 1893, and the gallery opened on 21 July 1897 as the National Gallery of British Art; however, from the start it was commonly known as the Tate Gallery, after its founder Sir Henry Tate, and in 1932 it officially adopted that name; before 2000, the gallery housed and displayed both British and modern collections, but the launch of Tate Modern saw Tate's modern collections move there, while the old Millbank gallery became dedicated to the display of historical and contemporary British art; as a consequence, it was renamed Tate Britain in March 2000; Tate Britain is the national gallery of British art from 1500 to the present day)uhttps://en.wikipedia.org/wiki/Tate_Britain aArt of Bloomsbury, c1999: t.p. verso (Tate Gallery);aTate Modern, 2000: p. 10 (Tate Modern, the gallery) axx00bjk0101382nz a2200241n 4500001000800000005001700008008004100025010002000066035002000086040003000106155004100136455002700177455003000204455003300234455003600267555001500303670049500318670023100813910005301044985000801097985002301105906001201128985891320150514055905.0141201|| anznnbabn |a ana c agsafd2014026217 agsafd2014026217 aIlChALCSbengcDLCflcgft aC436826 Action and adventure fiction aC436826 Action fiction aC436826 Adventure fiction aC436826 Swashbuckler fiction aC436826 Swashbucklers (Fiction) wgaFiction aSaricks, J. Readers' advisory guide to genre fiction, 2009:bp. 17 (novels in the Adventure genre are action-packed, feature a hero on a mission, and are often set in exotic locales during times of war and peace; characteristics of adventure: pacing is generally brisk, as the hero escapes from one dangerous episode to the next; the story line focuses on action, usually a mission; there is always an identifiable hero; detailed settings are important, generally 'elsewhere', i.e. foreign) aGSAFD, 2000b(Adventure fiction. UFs: Adventure stories, Swashbucklers; use for works characterized by an emphasis on physical and often violent action, exotic locales, and dangers, generally with little character development) aProposal saved by tc03 on 04/18/2015 at 09:00:56 aMvI eLiterature project t1515v0 |
Oops, something went wrong.