@@ -31,6 +31,10 @@ Cypress.Commands.add("clickBack", () => {
3131 cy . get ( 'button' ) . contains ( 'BACK' ) . click ( )
3232} )
3333
34+ Cypress . Commands . add ( 'clickInfo' , ( ) => {
35+ cy . get ( '.info' ) . click ( )
36+ } )
37+
3438Cypress . Commands . add ( "makeAChoice" , ( stepId , choice ) => {
3539 cy . get ( stepId ) . find ( `[value="${ choice } "]` ) . check ( )
3640} )
@@ -47,33 +51,62 @@ Cypress.Commands.add('hasRecommendedLicense', (license) => {
4751Cypress . Commands . add ( 'hasLicenseInAttributionCode' , ( license ) => {
4852 cy . get ( '.license-use-card' ) . should ( 'be.visible' ) . contains ( license )
4953} )
54+
5055Cypress . Commands . add ( 'hasStepsCount' , ( stepsCount ) => {
5156 cy . get ( '.stepper__container' ) . find ( '.step-container' ) . should ( 'have.lengthOf' , stepsCount )
5257} )
58+
5359Cypress . Commands . add ( 'missingLicenseInAttributionCode' , ( ) => {
5460 cy . get ( '.license-use-card' ) . should ( 'not.exist' )
5561} )
62+
5663Cypress . Commands . add ( 'headerTitle' , ( license ) => {
5764 cy . get ( '.license-short-name > .b-header' ) . contains ( license )
5865} )
66+
5967Cypress . Commands . add ( 'readableStringTitle' , ( license ) => {
6068 cy . get ( 'b' ) . contains ( license )
6169} )
70+
6271Cypress . Commands . add ( 'licenseText' , ( license ) => {
6372 cy . get ( '.license-text > a' ) . contains ( license )
6473} )
74+
6575Cypress . Commands . add ( 'copyButton' , ( text ) => {
6676 cy . get ( '.donate' ) . contains ( text ) . click ( )
6777} )
78+
79+ Cypress . Commands . add ( 'missingInputField' , ( id ) => {
80+ cy . get ( `:nth-child(${ id } ) > label.is-normal > .control-inner > .input` ) . should ( 'not.exist' )
81+ } )
82+
83+ Cypress . Commands . add ( 'visibleInputField' , ( id ) => {
84+ cy . get ( `:nth-child(${ id } ) > label.is-normal > .control-inner > .input` ) . should ( 'exist' )
85+ } )
86+
6887Cypress . Commands . add ( 'selectInputField' , ( id , text ) => {
6988 cy . get ( `:nth-child(${ id } ) > label.is-normal > .control-inner > .input` ) . type ( text )
7089} )
90+
7191Cypress . Commands . add ( 'valueOfInputField' , ( id , attr ) => {
7292 cy . get ( `:nth-child(${ id } ) > label.is-normal > .control-inner > .input` ) . invoke ( 'val' )
7393 . then ( ( text ) => {
7494 cy . get ( `${ attr } ` ) . contains ( text )
7595 } )
7696} )
97+
7798Cypress . Commands . add ( 'toggleButton' , ( ) => {
7899 cy . get ( '#copy-type' ) . click ( )
79100} )
101+
102+ Cypress . Commands . add ( 'openModal' , ( ) => {
103+ cy . get ( '.modal' ) . should ( 'exist' )
104+ } )
105+
106+ Cypress . Commands . add ( 'missingModal' , ( ) => {
107+ cy . get ( '.modal' ) . should ( 'not.exist' )
108+ } )
109+
110+ Cypress . Commands . add ( 'clickClose' , ( ) => {
111+ cy . get ( '.close-button' ) . click ( )
112+ } )
0 commit comments