@@ -84,7 +84,7 @@ describe("Batch sample creation", () => {
8484 cy . visit ( "/" ) ;
8585 } ) ;
8686 it ( "Adds 3 valid samples" , ( ) => {
87- cy . contains ( "Add batch of items ") . click ( ) ;
87+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
8888 getSubmitButton ( ) . should ( "be.disabled" ) ;
8989 getBatchAddCell ( 1 , 1 ) . type ( "testA" ) ;
9090 getBatchAddCell ( 2 , 1 ) . type ( "testB" ) ;
@@ -107,7 +107,7 @@ describe("Batch sample creation", () => {
107107 } ) ;
108108
109109 it ( "adds two valid samples" , ( ) => {
110- cy . contains ( "Add batch of items ") . click ( ) ;
110+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
111111 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 2 ) ;
112112
113113 cy . get ( '[data-testid="batch-modal-container"]' ) . findByText ( "Submit" ) . should ( "be.disabled" ) ;
@@ -126,7 +126,7 @@ describe("Batch sample creation", () => {
126126 } ) ;
127127
128128 it ( "adds four base samples" , ( ) => {
129- cy . contains ( "Add batch of items ") . click ( ) ;
129+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
130130 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 4 ) ;
131131
132132 cy . get ( '[data-testid="batch-modal-container"]' ) . findByText ( "Submit" ) . should ( "be.disabled" ) ;
@@ -189,7 +189,7 @@ describe("Batch sample creation", () => {
189189 } ) ;
190190
191191 it ( "makes samples copied from others" , ( ) => {
192- cy . contains ( "Add batch of items ") . click ( ) ;
192+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
193193 getBatchAddCell ( 1 , 1 ) . type ( "baseA_copy" ) ;
194194 getBatchAddCell ( 1 , 2 ) . type ( "a copied sample" ) ;
195195 getBatchAddCell ( 1 , 4 , ".vs__search" ) . type ( "BaseA" ) ;
@@ -253,7 +253,7 @@ describe("Batch sample creation", () => {
253253 } ) ;
254254
255255 it ( "creates samples using components" , ( ) => {
256- cy . contains ( "Add batch of items ") . click ( ) ;
256+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
257257 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 4 ) ;
258258
259259 // sample with two components
@@ -416,7 +416,7 @@ describe("Batch sample creation", () => {
416416 } ) ;
417417
418418 it ( "uses the template id" , ( ) => {
419- cy . contains ( "Add batch of items ") . click ( ) ;
419+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
420420 getBatchTemplateCell ( 1 ) . type ( "test_{{}#{}}" ) ;
421421
422422 // manually type names and a date
@@ -441,7 +441,7 @@ describe("Batch sample creation", () => {
441441 } ) ;
442442
443443 it ( "uses the template id, name, and date" , ( ) => {
444- cy . contains ( "Add batch of items ") . click ( ) ;
444+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
445445 getBatchTemplateCell ( 1 ) . type ( "test_{{}#{}}" ) ;
446446 getBatchTemplateCell ( 2 ) . type ( "this is the test sample #{{}#{}}" ) ;
447447 getBatchTemplateCell ( 3 ) . type ( "1980-02-01T05:35" ) ;
@@ -464,7 +464,7 @@ describe("Batch sample creation", () => {
464464 } ) ;
465465
466466 it ( "uses the template id, name, date, copyFrom, and components" , ( ) => {
467- cy . contains ( "Add batch of items ") . click ( ) ;
467+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
468468 getBatchTemplateCell ( 1 ) . type ( "test_{{}#{}}" ) ;
469469 getBatchTemplateCell ( 2 ) . type ( "this is the test sample #{{}#{}}" ) ;
470470 getBatchTemplateCell ( 3 ) . type ( "1980-02-01T23:59" ) ;
@@ -545,7 +545,7 @@ describe("Batch sample creation", () => {
545545 } ) ;
546546
547547 it ( "plays with the number of rows" , ( ) => {
548- cy . contains ( "Add batch of items ") . click ( ) ;
548+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
549549 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 3 ) ;
550550 cy . get ( "[data-testid=batch-add-table] > tbody > tr" ) . should ( "have.length" , 3 ) ;
551551
@@ -653,7 +653,7 @@ describe("Batch sample creation", () => {
653653 } ) ;
654654
655655 it ( "checks errors on the row" , ( ) => {
656- cy . contains ( "Add batch of items ") . click ( ) ;
656+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
657657 getBatchTemplateCell ( "1" ) . type ( "test10{{}#{}}" ) ;
658658 cy . wait ( 100 ) ;
659659 getSubmitButton ( ) . should ( "be.disabled" ) ;
@@ -716,7 +716,7 @@ describe("Batch cell creation", () => {
716716 } ) ;
717717
718718 it ( "creates a simple batch of cells" , ( ) => {
719- cy . contains ( "Add batch of items ") . click ( ) ;
719+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
720720 cy . get ( "[data-testid=batch-modal-container]" ) . findByLabelText ( "Type:" ) . select ( "cell" ) ;
721721 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 4 ) ;
722722 cy . get ( "[data-testid=batch-add-table] > tbody > tr" ) . should ( "have.length" , 4 ) ;
@@ -744,7 +744,7 @@ describe("Batch cell creation", () => {
744744 } ) ;
745745
746746 it ( "adds some component samples to be used for the next tests" , ( ) => {
747- cy . contains ( "Add batch of items ") . click ( ) ;
747+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
748748 cy . findByLabelText ( "Number of rows:" ) . clear ( ) . type ( 2 ) ;
749749
750750 getBatchAddCell ( 1 , 1 ) . type ( "comp1" ) ;
@@ -757,7 +757,7 @@ describe("Batch cell creation", () => {
757757 } ) ;
758758
759759 it ( "creates a batch of cells using the template id, name, date, copyFrom, and components" , ( ) => {
760- cy . contains ( "Add batch of items ") . click ( ) ;
760+ cy . findByTestId ( " batch-item-button ") . click ( ) ;
761761
762762 cy . get ( "[data-testid=batch-modal-container]" ) . findByLabelText ( "Type:" ) . select ( "cell" ) ;
763763
0 commit comments