@@ -63,14 +63,15 @@ Cypress.Commands.add('deckCreateList', ({ user, password }, title) => {
6363 cy . get ( '#stack-add form input[type=submit]' ) . first ( ) . click ( )
6464} )
6565
66- Cypress . Commands . add ( 'createExampleBoard' , ( { user, password, board } ) => {
66+ Cypress . Commands . add ( 'createExampleBoard' , ( { user, board } ) => {
67+ const auth = {
68+ user : user . userId ,
69+ password : user . password ,
70+ }
6771 cy . request ( {
6872 method : 'POST' ,
6973 url : `${ Cypress . env ( 'baseUrl' ) } /index.php/apps/deck/api/v1.0/boards` ,
70- auth : {
71- user,
72- password,
73- } ,
74+ auth,
7475 body : { title : board . title , color : board . color ?? 'ff0000' } ,
7576 } ) . then ( ( boardResponse ) => {
7677 expect ( boardResponse . status ) . to . eq ( 200 )
@@ -80,10 +81,7 @@ Cypress.Commands.add('createExampleBoard', ({ user, password, board }) => {
8081 cy . request ( {
8182 method : 'POST' ,
8283 url : `${ Cypress . env ( 'baseUrl' ) } /index.php/apps/deck/api/v1.0/boards/${ boardData . id } /stacks` ,
83- auth : {
84- user,
85- password,
86- } ,
84+ auth,
8785 body : { title : stack . title , order : 0 } ,
8886 } ) . then ( ( stackResponse ) => {
8987 const stackData = stackResponse . body
@@ -92,15 +90,13 @@ Cypress.Commands.add('createExampleBoard', ({ user, password, board }) => {
9290 cy . request ( {
9391 method : 'POST' ,
9492 url : `${ Cypress . env ( 'baseUrl' ) } /index.php/apps/deck/api/v1.0/boards/${ boardData . id } /stacks/${ stackData . id } /cards` ,
95- auth : {
96- user,
97- password,
98- } ,
93+ auth,
9994 body : { title : card . title } ,
10095 } )
10196 }
10297 } )
10398 }
99+ cy . wrap ( boardData )
104100 } )
105101} )
106102
@@ -109,3 +105,13 @@ Cypress.Commands.add('getNavigationEntry', (boardTitle) => {
109105 . find ( 'ul.app-navigation-entry__children .app-navigation-entry:contains(' + boardTitle + ')' )
110106 . find ( 'a.app-navigation-entry-link' )
111107} )
108+
109+ Cypress . Commands . add ( 'shareBoardWithUi' , ( userId ) => {
110+ cy . get ( '[aria-label="Open details"]' ) . click ( )
111+ cy . get ( '.app-sidebar' ) . should ( 'be.visible' )
112+ cy . get ( '.multiselect__input' ) . type ( `${ userId } ` )
113+ cy . get ( '.multiselect__content .multiselect__element' ) . first ( ) . contains ( userId )
114+ cy . get ( '.multiselect__input' ) . type ( '{enter}' )
115+
116+ cy . get ( '.shareWithList' ) . contains ( userId )
117+ } )
0 commit comments