@@ -33,18 +33,12 @@ describe('Open uni population tests', () => {
3333 cy . get ( '[data-cy="open-uni-search-button"]' ) . click ( )
3434 cy . contains ( 'Insert course code(s)' ) . siblings ( ) . get ( 'textarea' ) . as ( 'textarea' )
3535 cy . get ( '@textarea' ) . type ( courseCodesSet1 . join ( '\n' ) )
36- cy . cs ( 'begin-of-search' )
37- . click ( )
38- . then ( ( ) => {
39- cy . cs ( 'begin-of-search' ) . clear ( )
40- cy . cs ( 'begin-of-search' ) . type ( '01.01.2015' )
41- } )
42- cy . cs ( 'end-of-search' )
43- . click ( )
44- . then ( ( ) => {
45- cy . cs ( 'end-of-search' ) . clear ( )
46- cy . cs ( 'end-of-search' ) . type ( '01.01.2020' )
47- } )
36+ cy . cs ( 'begin-of-search' ) . click ( )
37+ cy . cs ( 'begin-of-search' ) . clear ( )
38+ cy . cs ( 'begin-of-search' ) . type ( '01.01.2015' )
39+ cy . cs ( 'end-of-search' ) . click ( )
40+ cy . cs ( 'end-of-search' ) . clear ( )
41+ cy . cs ( 'end-of-search' ) . type ( '01.01.2020' )
4842 cy . get ( 'button' ) . contains ( 'Search population' ) . click ( )
4943 cy . contains ( 'Beginning of the search for all fields:' )
5044 cy . contains ( '01.01.2015' )
@@ -86,9 +80,10 @@ describe('Open uni population tests', () => {
8680 cy . get ( '[data-cy="search-name"]' ) . type ( 'TEST-Avoimen-populaatio' )
8781 cy . contains ( 'Insert course code(s)' ) . siblings ( ) . get ( 'textarea' ) . type ( courseCodesSet1 . join ( '\n' ) )
8882 cy . get ( '[data-cy="save-search"]' ) . click ( )
89- cy . get ( '[data-cy="history-search"]' ) . children ( ) . eq ( 0 ) . type ( 'TEST-Avoimen-populaatio' ) . type ( ' {enter}')
83+ cy . get ( '[data-cy="history-search"]' ) . children ( ) . eq ( 0 ) . type ( 'TEST-Avoimen-populaatio{enter}' )
9084 cy . contains ( 'TEST-Avoimen-populaatio' )
91- cy . get ( 'button' ) . contains ( 'Search population' ) . click ( )
85+ cy . get ( 'button' ) . contains ( 'Search population' ) . as ( 'btn' )
86+ cy . get ( '@btn' ) . click ( )
9287 cy . get ( '[data-cy="open-uni-table-div"]' ) . should ( 'contain.text' , courseCodesSet1 [ 0 ] )
9388 cy . get ( '[data-cy="open-uni-table-div"]' ) . should ( 'contain.text' , courseCodesSet1 [ 1 ] )
9489 } )
@@ -105,7 +100,7 @@ describe('Open uni population tests', () => {
105100 cy . get ( '[data-cy="open-uni-table-div"]' ) . should ( 'contain.text' , courseCodesSet1 [ 1 ] )
106101
107102 cy . get ( '[data-cy="open-uni-search-button"]' ) . click ( )
108- cy . get ( '[data-cy="history-search"]' ) . children ( ) . eq ( 0 ) . type ( 'TEST-Avoimen-populaatio' ) . type ( ' {enter}')
103+ cy . get ( '[data-cy="history-search"]' ) . children ( ) . eq ( 0 ) . type ( 'TEST-Avoimen-populaatio{enter}' )
109104 cy . contains ( 'Insert course code(s)' ) . siblings ( ) . get ( 'textarea' ) . should ( 'contain' , courseCodesSet1 . join ( ', ' ) )
110105 cy . contains ( 'Insert course code(s)' ) . siblings ( ) . get ( 'textarea' ) . type ( '\n' )
111106 cy . contains ( 'Insert course code(s)' ) . siblings ( ) . get ( 'textarea' ) . type ( courseCodesSet2 . join ( '\n' ) )
0 commit comments