@@ -5,8 +5,8 @@ before('Reset database', () => {
55const buildLocalityName = ( base = 'Bugat' ) => `${ base } ${ Date . now ( ) } -${ Math . floor ( Math . random ( ) * 1e6 ) } `
66
77describe ( 'Adding species in Locality -> Species tab for an existing locality' , ( ) => {
8- beforeEach ( 'Login as admin' , ( ) => {
9- cy . login ( 'testSu' )
8+ beforeEach ( 'Login as admin with session caching ' , ( ) => {
9+ cy . loginWithSession ( 'testSu' )
1010 } )
1111
1212 it ( 'works with valid, unique species' , ( ) => {
@@ -193,9 +193,8 @@ describe('Adding species in Locality -> Species tab for an existing locality', (
193193} )
194194
195195describe ( 'Creating a new locality' , ( ) => {
196- beforeEach ( 'Login as admin' , ( ) => {
197- cy . resetDatabase ( )
198- cy . login ( 'testSu' )
196+ beforeEach ( 'Login as admin with session caching' , ( ) => {
197+ cy . loginWithSession ( 'testSu' )
199198 } )
200199
201200 it ( 'with valid data works' , ( ) => {
@@ -415,8 +414,8 @@ describe('Creating a new locality', () => {
415414} )
416415
417416describe ( 'Editing a locality' , ( ) => {
418- beforeEach ( 'Login as admin' , ( ) => {
419- cy . login ( 'testSu' )
417+ beforeEach ( 'Login as admin with session caching ' , ( ) => {
418+ cy . loginWithSession ( 'testSu' )
420419 } )
421420
422421 it ( 'with contradictory min and max ages does not work' , ( ) => {
@@ -497,8 +496,8 @@ describe('Editing a locality', () => {
497496} )
498497
499498describe ( 'Locality table filtering' , ( ) => {
500- beforeEach ( 'Login as admin' , ( ) => {
501- cy . login ( 'testSu' )
499+ beforeEach ( 'Login as admin with session caching ' , ( ) => {
500+ cy . loginWithSession ( 'testSu' )
502501 } )
503502
504503 it ( 'supports filtering by synonym names' , ( ) => {
@@ -515,8 +514,8 @@ describe('Locality table filtering', () => {
515514// This test needs GEONAMES_USERNAME to be set in .anon.env!
516515
517516describe ( "Locality's coordinate selection map works" , ( ) => {
518- beforeEach ( 'Login as admin' , ( ) => {
519- cy . login ( 'testSu' )
517+ beforeEach ( 'Login as admin with session caching ' , ( ) => {
518+ cy . loginWithSession ( 'testSu' )
520519 } )
521520
522521 it ( 'Map view and location search work' , ( ) => {
@@ -585,8 +584,8 @@ describe("Locality's coordinate selection map works", () => {
585584} )
586585
587586describe ( 'Deleting a locality' , ( ) => {
588- beforeEach ( 'Login as admin' , ( ) => {
589- cy . login ( 'testSu' )
587+ beforeEach ( 'Login as admin with session caching ' , ( ) => {
588+ cy . loginWithSession ( 'testSu' )
590589 } )
591590
592591 it ( 'works and returns user to table view' , ( ) => {
@@ -610,8 +609,7 @@ describe('Linking projects to an existing locality', () => {
610609 const newProjectCode = 'WINE'
611610
612611 beforeEach ( 'Login as admin and open projects tab' , ( ) => {
613- cy . resetDatabase ( )
614- cy . login ( 'testSu' )
612+ cy . loginWithSession ( 'testSu' )
615613 cy . visit ( `/locality/${ localityId } ?tab=9` )
616614 cy . contains ( 'Dmanisi' )
617615 } )
0 commit comments