From c395e25c65733893cfdda46db7a10642ac48152c Mon Sep 17 00:00:00 2001 From: Ketul Shah Date: Tue, 19 Mar 2024 20:05:17 +0530 Subject: [PATCH] removed duplicate step definition and alignment Signed-off-by: Ketul Shah --- .../e2e/features/11-TestWriter.feature | 296 ++++++++---------- .../e2e/features/12-TestReader.feature | 152 ++++----- .../step_definitions/navigation_steps.js | 113 ++++--- 3 files changed, 254 insertions(+), 307 deletions(-) diff --git a/packages/apollo/test/cypress/e2e/features/11-TestWriter.feature b/packages/apollo/test/cypress/e2e/features/11-TestWriter.feature index 0b667c0d..cb4b3162 100644 --- a/packages/apollo/test/cypress/e2e/features/11-TestWriter.feature +++ b/packages/apollo/test/cypress/e2e/features/11-TestWriter.feature @@ -3,7 +3,7 @@ Feature: Verify allowed functions for Writer user Background: Login to console Given I go to the console - And I am logged in as 'writeruser@ibm.com' user + And I am logged in as 'writeruser@ibm.com' user And I am ready to get started Scenario: Setting up the identities @@ -77,164 +77,136 @@ Feature: Verify allowed functions for Writer user And I clicked the button with id 'associate_identity' Then wait "2" seconds - Scenario: Writer should be able to import components, writer is not allowed to create new components - And I am ready to get started - And I am on the 'nodes' page - And I clicked the button with title 'Add peer' - #Then Checkbox should not exist with 'Create a peer' - Then Checkbox should be hidden with id 'deploy-id' - Then Checkbox should be visible with 'Import an existing peer' - And I clicked the button with text 'Cancel' - And I am on the 'nodes' page - And I clicked the button with title 'Add Certificate Authority' - #Then Checkbox should not exist with 'Create a Certificate Authority' - Then Checkbox should be hidden with id 'deploy-id' - Then Checkbox should be visible with 'Import an existing Certificate Authority' - And I clicked the button with text 'Cancel' - And I am on the 'nodes' page - And I clicked the button with title 'Add ordering service' - #Then Checkbox should not exist with 'Create an ordering service' - Then Checkbox should be hidden with id 'deploy-id' - Then Checkbox should be visible with 'Import an existing ordering service' - And I clicked the button with text 'Cancel' - And I am on the 'nodes' page - - Scenario: Writer is not allowed to modify Access - And I am on the 'access' page - Then Message should be displayed 'Contact a user with the "Manager" role' - - Scenario: On the Settings page Writer is allowed import and export data - And I am on the 'settings' page - Then Button should be enabled for id 'data_export_button' - Then Button should be enabled for id 'data_import_button' - - # Scenario: Enrolling and associating Org1 CA Admin - # And I am on the 'nodes' page - # And I clicked the 'Org1 CA' certificate authority - # And I clicked the button with text 'Associated identity for root CA' - # And I clicked the button with text 'Enroll ID' - # And I provided 'admin' for the 'Enter an ID' input - # And I provided 'adminpw' for the 'Enter a secret' input - # And I provided 'Org1 CA Admin' for the 'Enter a name' input - # And I clicked the button with id 'associate_identity' - # And the CA admin is set as 'Org1 CA Admin' - # Then wait "3" seconds - - Scenario: For Writers registering new user should be enabled - And I am on the 'nodes' page - And I clicked the 'Org1 CA' certificate authority - Then Button should be enabled for title 'Register user' - Then Button should be enabled for id 'btn-ca_users-reenroll' + Scenario: Writer should be able to import components, writer is not allowed to create new components + And I am ready to get started + And I am on the 'nodes' page + And I clicked the button with title 'Add peer' + #Then Checkbox should not exist with 'Create a peer' + Then Checkbox should be hidden with id 'deploy-id' + Then Checkbox should be visible with 'Import an existing peer' + And I clicked the button with text 'Cancel' + And I am on the 'nodes' page + And I clicked the button with title 'Add Certificate Authority' + #Then Checkbox should not exist with 'Create a Certificate Authority' + Then Checkbox should be hidden with id 'deploy-id' + Then Checkbox should be visible with 'Import an existing Certificate Authority' + And I clicked the button with text 'Cancel' + And I am on the 'nodes' page + And I clicked the button with title 'Add ordering service' + #Then Checkbox should not exist with 'Create an ordering service' + Then Checkbox should be hidden with id 'deploy-id' + Then Checkbox should be visible with 'Import an existing ordering service' + And I clicked the button with text 'Cancel' + And I am on the 'nodes' page - # Scenario: Deleting Org1 CA Admin from wallet - # And I am on the 'wallet' page - # And I clicked the div with text 'Org1 CA Admin' - # And I clicked the button with text 'Remove identity' - # And I provided 'Org1 CA Admin' for the 'Type here' input - # And I clicked the button with text 'Remove identity' + Scenario: Writer is not allowed to modify Access + And I am on the 'access' page + Then Message should be displayed 'Contact a user with the "Manager" role' -# Writer is allowed to import Ordering Services and Ordering Nodes - Scenario: Renaming 'Ordering Service' to 'Ordering Service Org' - And I navigate to the 'nodes' page - And I clicked the node 'Ordering Service' - And I clicked the button with id 'orderingservicenode1-sticky-settings-button' - And I provided 'Ordering Service Org' for input field with id 'ordererModal-display_name' - And I clicked the button with id 'update_peer' + Scenario: On the Settings page Writer is allowed import and export data + And I am on the 'settings' page + Then Button should be enabled for id 'data_export_button' + Then Button should be enabled for id 'data_import_button' - Scenario: Importing Ordering Service - And I navigate to the 'nodes' page - And I clicked the button with title 'Add ordering service' - And I clicked the div with text 'Import an existing ordering service' - And I clicked the button with id 'next' - And I clicked the div with text 'Add file' + Scenario: For Writers registering new user should be enabled + And I am on the 'nodes' page + And I clicked the 'Org1 CA' certificate authority + Then Button should be enabled for title 'Register user' + Then Button should be enabled for id 'btn-ca_users-reenroll' + + # Writer is allowed to import Ordering Services and Ordering Nodes + Scenario: Renaming 'Ordering Service' to 'Ordering Service Org' + And I navigate to the 'nodes' page + And I clicked the node 'Ordering Service' + And I clicked the button with id 'orderingservicenode1-sticky-settings-button' + And I provided 'Ordering Service Org' for input field with id 'ordererModal-display_name' + And I clicked the button with id 'update_peer' + + Scenario: Importing Ordering Service + And I navigate to the 'nodes' page + And I clicked the button with title 'Add ordering service' + And I clicked the div with text 'Import an existing ordering service' + And I clicked the button with id 'next' + And I clicked the div with text 'Add file' And I upload file 'fixtures/test_data/Import/Ordering_Service_orderer_to_import.json' - Then wait "5" seconds - And I clicked the button with id 'submit' - Then wait "15" seconds - - Scenario: Deleting imported Ordering Service_1 - And I navigate to the 'nodes' page - And I clicked the node 'Ordering Service' - And I clicked the button with id 'ibp-orderer-nodes' - And I clicked the node 'Ordering Service_1' - And I clicked the button with id 'orderingservice_1-sticky-delete-button' - And I provided 'Ordering Service_1' for the 'Type here' input - And I clicked the button with id 'confirm_remove' - - Scenario: Importing Ordering Service_1 - And I navigate to the 'nodes' page - And I clicked the node 'Ordering Service' - And I clicked the button with id 'ibp-orderer-nodes' - And I clicked the button with title 'Add another node' - And I clicked the div with text 'Import an existing ordering node' - And I clicked the button with id 'next' - And I clicked the div with text 'Add file' + Then wait "5" seconds + And I clicked the button with id 'submit' + Then wait "15" seconds + + Scenario: Deleting imported Ordering Service_1 + And I navigate to the 'nodes' page + And I clicked the node 'Ordering Service' + And I clicked the button with id 'ibp-orderer-nodes' + And I clicked the node 'Ordering Service_1' + And I clicked the button with id 'orderingservice_1-sticky-delete-button' + And I provided 'Ordering Service_1' for the 'Type here' input + And I clicked the button with id 'confirm_remove' + + Scenario: Importing Ordering Service_1 + And I navigate to the 'nodes' page + And I clicked the node 'Ordering Service' + And I clicked the button with id 'ibp-orderer-nodes' + And I clicked the button with title 'Add another node' + And I clicked the div with text 'Import an existing ordering node' + And I clicked the button with id 'next' + And I clicked the div with text 'Add file' And I upload file 'fixtures/test_data/Import/Ordering_Service_1_orderer_to_import.json' - Then wait "5" seconds - And I clicked the button with id 'submit' - - Scenario: Deleting imported Ordering Service - And I navigate to the 'nodes' page - And I clicked the 'Ordering Service' orderer - And I clicked the button with id 'orderingservice_1-sticky-delete-button' - And I provided 'Ordering Service' for the 'Type here' input - And I clicked the button with id 'confirm_remove' - - Scenario: Renaming 'Ordering Service Org' to 'Ordering Service' - And I navigate to the 'nodes' page - And I clicked the node 'Ordering Service Org' - And I clicked the button with id 'orderingservicenode1-sticky-settings-button' - And I provided 'Ordering Service' for input field with id 'ordererModal-display_name' - And I clicked the button with id 'update_peer' - And I navigate to the 'nodes' page - - Scenario: Writer should be able to export, import and delete imported Peers or CAs - And I navigate to the 'nodes' page - And I clicked the node '' - And I clicked the button with id '-sticky-download-button' - - # Scenario: Renaming Peer/CA - And I navigate to the 'nodes' page - And I clicked the node '' - And I clicked the button with id '-sticky-settings-button' - And I provided ' Org' for input field with id 'Modal-display_name' - And I clicked the button with id 'update_' - - # Scenario: Importing Peer/CA - And I navigate to the 'nodes' page - And I clicked the button with title 'Add ' - And I clicked the div with text 'Import an existing ' - And I clicked the button with id 'next' - And I clicked the div with text 'Add file' - And I upload file 'cypress/downloads/_.json' - Then wait "5" seconds - And I clicked the button with id 'submit' - - # Scenario: Deleting imported Peer/CA - When I am logged in - And I am ready to get started - And I navigate to the 'nodes' page - And I clicked the node '' - And I clicked the button with id '_0-sticky-delete-button' - And I provided '' for the 'Type here' input - And I clicked the button with id 'confirm_remove' - - # Scenario: Renaming Peer/CA - And I navigate to the 'nodes' page - And I clicked the node ' Org' - And I clicked the button with id '-sticky-settings-button' - And I provided '' for input field with id 'Modal-display_name' - And I clicked the button with id 'update_' - And I navigate to the 'nodes' page - - # Components created by Ansible - # Examples: - # | componentTitle | componentId | componentName | buttonPrefix | - # | Certificate Authority | ca | Ordering Org CA | orderingorgca | - # | Certificate Authority | ca | Org1 CA | org1ca | - # | Certificate Authority | ca | Org2 CA | org2ca | - # | peer | peer | Org1 Peer | org1peer | - # | peer | peer | Org2 Peer | org2peer | + Then wait "5" seconds + And I clicked the button with id 'submit' + + Scenario: Deleting imported Ordering Service + And I navigate to the 'nodes' page + And I clicked the 'Ordering Service' orderer + And I clicked the button with id 'orderingservice_1-sticky-delete-button' + And I provided 'Ordering Service' for the 'Type here' input + And I clicked the button with id 'confirm_remove' + + Scenario: Renaming 'Ordering Service Org' to 'Ordering Service' + And I navigate to the 'nodes' page + And I clicked the node 'Ordering Service Org' + And I clicked the button with id 'orderingservicenode1-sticky-settings-button' + And I provided 'Ordering Service' for input field with id 'ordererModal-display_name' + And I clicked the button with id 'update_peer' + And I navigate to the 'nodes' page + + Scenario: Writer should be able to export, import and delete imported Peers or CAs + And I navigate to the 'nodes' page + And I clicked the node '' + And I clicked the button with id '-sticky-download-button' + + # Scenario: Renaming Peer/CA + And I navigate to the 'nodes' page + And I clicked the node '' + And I clicked the button with id '-sticky-settings-button' + And I provided ' Org' for input field with id 'Modal-display_name' + And I clicked the button with id 'update_' + + # Scenario: Importing Peer/CA + And I navigate to the 'nodes' page + And I clicked the button with title 'Add ' + And I clicked the div with text 'Import an existing ' + And I clicked the button with id 'next' + And I clicked the div with text 'Add file' + And I upload file 'cypress/downloads/_.json' + Then wait "5" seconds + And I clicked the button with id 'submit' + + # Scenario: Deleting imported Peer/CA + When I am logged in + And I am ready to get started + And I navigate to the 'nodes' page + And I clicked the node '' + And I clicked the button with id '_0-sticky-delete-button' + And I provided '' for the 'Type here' input + And I clicked the button with id 'confirm_remove' + + # Scenario: Renaming Peer/CA + And I navigate to the 'nodes' page + And I clicked the node ' Org' + And I clicked the button with id '-sticky-settings-button' + And I provided '' for input field with id 'Modal-display_name' + And I clicked the button with id 'update_' + And I navigate to the 'nodes' page # Components created by Cypress Examples: @@ -245,12 +217,12 @@ Feature: Verify allowed functions for Writer user # | peer | peer | Peer Org1 | peerorg1 | # | peer | peer | Peer Org2 | peerorg2 | - Scenario: For Writers updating chaincodes should be enabled - And I am on the 'channels' page - And I clicked the div with id 'ibp-tile-channel2' - Then wait "5" seconds - And I clicked the div with text 'fabcar' - Then Text should exist 'Update package details' - Then Button should be enabled for id 'update-approval-org1msp' - Then wait "10" seconds + Scenario: For Writers updating chaincodes should be enabled + And I am on the 'channels' page + And I clicked the div with id 'ibp-tile-channel2' + Then wait "5" seconds + And I clicked the div with text 'fabcar' + Then Text should exist 'Update package details' + Then Button should be enabled for id 'update-approval-org1msp' + Then wait "10" seconds Then I clicked the button with id 'cancel' diff --git a/packages/apollo/test/cypress/e2e/features/12-TestReader.feature b/packages/apollo/test/cypress/e2e/features/12-TestReader.feature index 295c07ec..2dc554e9 100644 --- a/packages/apollo/test/cypress/e2e/features/12-TestReader.feature +++ b/packages/apollo/test/cypress/e2e/features/12-TestReader.feature @@ -8,37 +8,37 @@ Feature: Verify allowed functions for Reader user Scenario: Setting up the identities # Associate identigies for CAs - And I am on the 'nodes' page - And I clicked the 'Org1 CA' certificate authority - And I clicked the button with id 'no-identity-button' - And I provided 'admin' for the 'Enter an ID' input - And I provided 'adminpw' for the 'Enter a secret' input - And I provided 'Org1 CA Admin' for the 'Enter a name' input - And I clicked the button with id 'associate_identity' - And the CA admin is set as 'Org1 CA Admin' - Then the 'admin' user with id 'org1admin' should be enrolled - And the 'peer' user with id 'peer1' should be enrolled - When I am on the 'nodes' page - And I clicked the 'Ordering Service CA' certificate authority - And I clicked the button with text 'Associate identity' - And I provided 'admin' for the 'Enter an ID' input - And I provided 'adminpw' for the 'Enter a secret' input - And I provided 'Ordering Service CA Admin' for the 'Enter a name' input - And I clicked the button with id 'associate_identity' - And the CA admin is set as 'Ordering Service CA Admin' - Then the 'admin' user with id 'OSadmin' should be enrolled - And the 'orderer' user with id 'OS1' should be enrolled - And I enroll TLS identity for OS1 with secret 'OS1pw' and name 'TLSOS1' - And I am on the 'nodes' page - And I clicked the 'Org2 CA' certificate authority - And I clicked the button with id 'no-identity-button' - And I provided 'admin' for the 'Enter an ID' input - And I provided 'adminpw' for the 'Enter a secret' input - And I provided 'Org2 CA Admin' for the 'Enter a name' input - And I clicked the button with id 'associate_identity' - And the CA admin is set as 'Org2 CA Admin' - Then the 'admin' user with id 'org2admin' should be enrolled - And the 'peer' user with id 'peer2' should be enrolled + And I am on the 'nodes' page + And I clicked the 'Org1 CA' certificate authority + And I clicked the button with id 'no-identity-button' + And I provided 'admin' for the 'Enter an ID' input + And I provided 'adminpw' for the 'Enter a secret' input + And I provided 'Org1 CA Admin' for the 'Enter a name' input + And I clicked the button with id 'associate_identity' + And the CA admin is set as 'Org1 CA Admin' + Then the 'admin' user with id 'org1admin' should be enrolled + And the 'peer' user with id 'peer1' should be enrolled + When I am on the 'nodes' page + And I clicked the 'Ordering Service CA' certificate authority + And I clicked the button with text 'Associate identity' + And I provided 'admin' for the 'Enter an ID' input + And I provided 'adminpw' for the 'Enter a secret' input + And I provided 'Ordering Service CA Admin' for the 'Enter a name' input + And I clicked the button with id 'associate_identity' + And the CA admin is set as 'Ordering Service CA Admin' + Then the 'admin' user with id 'OSadmin' should be enrolled + And the 'orderer' user with id 'OS1' should be enrolled + And I enroll TLS identity for OS1 with secret 'OS1pw' and name 'TLSOS1' + And I am on the 'nodes' page + And I clicked the 'Org2 CA' certificate authority + And I clicked the button with id 'no-identity-button' + And I provided 'admin' for the 'Enter an ID' input + And I provided 'adminpw' for the 'Enter a secret' input + And I provided 'Org2 CA Admin' for the 'Enter a name' input + And I clicked the button with id 'associate_identity' + And the CA admin is set as 'Org2 CA Admin' + Then the 'admin' user with id 'org2admin' should be enrolled + And the 'peer' user with id 'peer2' should be enrolled # Import identity in wallet Given I am on the 'wallet' page And I clicked the button with title 'Add identity' @@ -77,66 +77,46 @@ Feature: Verify allowed functions for Reader user And I clicked the button with id 'associate_identity' Then wait "2" seconds - Scenario: Reader is not allowed to create Peers, CAs and Ordering Services - And I am on the 'nodes' page - Then Button should be disabled for title 'Add peer' - Then Button should be disabled for title 'Add Certificate Authority' - Then Button should be disabled for title 'Add ordering service' - - Scenario: Reader is not allowed to create or join channels - And I am on the 'channels' page - Then Button should be disabled for title 'Create channel' - Then Button should be disabled for title 'Join channel' - - Scenario: Reader is not allowed to install smart contracts - And I am on the 'smart_contracts' page - Then Button should be disabled for title 'Install smart contract' + Scenario: Reader is not allowed to create Peers, CAs and Ordering Services + And I am on the 'nodes' page + Then Button should be disabled for title 'Add peer' + Then Button should be disabled for title 'Add Certificate Authority' + Then Button should be disabled for title 'Add ordering service' - Scenario: Reader is not allowed to create or import organizations - And I am on the 'organizations' page - Then Button should be disabled for title 'Create MSP definition' - Then Button should be disabled for title 'Import MSP definition' + Scenario: Reader is not allowed to create or join channels + And I am on the 'channels' page + Then Button should be disabled for title 'Create channel' + Then Button should be disabled for title 'Join channel' - Scenario: Reader is not allowed to modify Access - And I am on the 'access' page - Then Message should be displayed 'Contact a user with the "Manager" role' + Scenario: Reader is not allowed to install smart contracts + And I am on the 'smart_contracts' page + Then Button should be disabled for title 'Install smart contract' - Scenario: On the Settings page Reader is allowed export data, import button should not be visible - And I am on the 'settings' page - Then Button should be enabled for id 'data_export_button' - Then Text should not exist 'Import' + Scenario: Reader is not allowed to create or import organizations + And I am on the 'organizations' page + Then Button should be disabled for title 'Create MSP definition' + Then Button should be disabled for title 'Import MSP definition' - # Scenario: Enrolling and associating Org1 CA Admin - # And I am on the 'nodes' page - # And I clicked the 'Org1 CA' certificate authority - # And I clicked the button with text 'Associated identity for root CA' - # And I clicked the button with text 'Enroll ID' - # And I provided 'admin' for the 'Enter an ID' input - # And I provided 'adminpw' for the 'Enter a secret' input - # And I provided 'Org1 CA Admin' for the 'Enter a name' input - # And As Reader I clicked the button with id 'associate_identity' - # And the CA admin is set as 'Org1 CA Admin' - # Then wait "5" seconds + Scenario: Reader is not allowed to modify Access + And I am on the 'access' page + Then Message should be displayed 'Contact a user with the "Manager" role' - Scenario: For Readers registering new user should be disabled - And I am on the 'nodes' page - And I clicked the 'Org1 CA' certificate authority - Then Button should be disabled for id 'btn-ca_users-register_user' - Then Button should be disabled for id 'btn-ca_users-reenroll' + Scenario: On the Settings page Reader is allowed export data, import button should not be visible + And I am on the 'settings' page + Then Button should be enabled for id 'data_export_button' + Then Text should not exist 'Import' - # Scenario: Deleting Org1 CA Admin from wallet - # And I am on the 'wallet' page - # And I clicked the div with text 'Org1 CA Admin' - # And I clicked the button with text 'Remove identity' - # And I provided 'Org1 CA Admin' for the 'Type here' input - # And I clicked the button with text 'Remove identity' + Scenario: For Readers registering new user should be disabled + And I am on the 'nodes' page + And I clicked the 'Org1 CA' certificate authority + Then Button should be disabled for id 'btn-ca_users-register_user' + Then Button should be disabled for id 'btn-ca_users-reenroll' - Scenario: For Readers updating chaincodes should not be enabled - And I am on the 'channels' page - And I clicked the div with id 'ibp-tile-channel2' - Then wait "5" seconds - And I clicked the div with text 'fabcar' - # Then Button should not be visible for id 'update-approval-Org1MSP' - Then Text should not exist 'Update package details' - Then wait "10" seconds + Scenario: For Readers updating chaincodes should not be enabled + And I am on the 'channels' page + And I clicked the div with id 'ibp-tile-channel2' + Then wait "5" seconds + And I clicked the div with text 'fabcar' + Then Text should not exist 'Update package details' + Then wait "10" seconds Then I clicked the button with id 'cancel' diff --git a/packages/apollo/test/cypress/support/step_definitions/navigation_steps.js b/packages/apollo/test/cypress/support/step_definitions/navigation_steps.js index bbca588e..f1b690d2 100644 --- a/packages/apollo/test/cypress/support/step_definitions/navigation_steps.js +++ b/packages/apollo/test/cypress/support/step_definitions/navigation_steps.js @@ -108,77 +108,72 @@ Then("I reload the page", () => { cy.reload() }); -Then(/^the div with id (?:'|")(.*?)(?:'|") does not exist on page$/, value => { - cy.wait(1000) - cy.get(`div[id="${value}"]`).should('not.exist'); - }); +Then(/^Button should be enabled for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { +//cy.clickButton(property, value); +cy.log('property = ' + property) +cy.log('value = ' + value) +cy.get('button[' + property + '="' + value + '"]').should('be.enabled') - Then(/^Button should be enabled for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { - //cy.clickButton(property, value); - cy.log('property = ' + property) - cy.log('value = ' + value) - cy.get('button[' + property + '="' + value + '"]').should('be.enabled') - - }); +}); - Then(/^Button should be disabled for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { - //cy.clickButton(property, value); - cy.log('property = ' + property) - cy.log('value = ' + value) - cy.get('button[' + property + '="' + value + '"]').should('be.disabled') +Then(/^Button should be disabled for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { +//cy.clickButton(property, value); +cy.log('property = ' + property) +cy.log('value = ' + value) +cy.get('button[' + property + '="' + value + '"]').should('be.disabled') - }); +}); - Then(/^Button should be visible for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { - //cy.clickButton(property, value); - cy.log('property = ' + property) - cy.log('value = ' + value) - cy.get('button[' + property + '="' + value + '"]').should('be.visible') +Then(/^Button should be visible for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { +//cy.clickButton(property, value); +cy.log('property = ' + property) +cy.log('value = ' + value) +cy.get('button[' + property + '="' + value + '"]').should('be.visible') - }); +}); - Then(/^Button should not be visible for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { - //cy.clickButton(property, value); - cy.log('property = ' + property) - cy.log('value = ' + value) - cy.get('button[' + property + '="' + value + '"]').should('not.be.visible') +Then(/^Button should not be visible for (text|title|id|xpath) (?:'|")(.*?)(?:'|")$/, (property, value) => { +//cy.clickButton(property, value); +cy.log('property = ' + property) +cy.log('value = ' + value) +cy.get('button[' + property + '="' + value + '"]').should('not.be.visible') - }); +}); - Then(/^Checkbox should be visible with (?:'|")(.*?)(?:'|")$/, (value) => { - cy.get('label').contains(value).should('be.visible') - }); +Then(/^Checkbox should be visible with (?:'|")(.*?)(?:'|")$/, (value) => { +cy.get('label').contains(value).should('be.visible') +}); - Then(/^Checkbox should be hidden with id (?:'|")(.*?)(?:'|")$/, (value) => { - // cy.get('label').contains(value).should('be.hidden') - cy.get('input[id="deploy-id"]').should('be.hidden') - }); +Then(/^Checkbox should be hidden with id (?:'|")(.*?)(?:'|")$/, (value) => { +// cy.get('label').contains(value).should('be.hidden') +cy.get('input[id="deploy-id"]').should('be.hidden') +}); - Then(/^Checkbox should not be visible with (?:'|")(.*?)(?:'|")$/, (value) => { - cy.get('label').contains(value).should('not.be.visible') - }); +Then(/^Checkbox should not be visible with (?:'|")(.*?)(?:'|")$/, (value) => { +cy.get('label').contains(value).should('not.be.visible') +}); - Then(/^Checkbox should not exist with (?:'|")(.*?)(?:'|")$/, (value) => { - cy.get('label').contains(value).should('not.exist') - }); +Then(/^Checkbox should not exist with (?:'|")(.*?)(?:'|")$/, (value) => { +cy.get('label').contains(value).should('not.exist') +}); - Then(/^Message should be displayed (?:'|")(.*?)(?:'|")$/, (msg) => { - cy.contains(msg) - }); +Then(/^Message should be displayed (?:'|")(.*?)(?:'|")$/, (msg) => { +cy.contains(msg) +}); - Then(/^Text should not exist (?:'|")(.*?)(?:'|")$/, (text) => { - cy.contains(text).should('not.exist') - }); +Then(/^Text should not exist (?:'|")(.*?)(?:'|")$/, (text) => { +cy.contains(text).should('not.exist') +}); - Then(/^Text should exist (?:'|")(.*?)(?:'|")$/, (text) => { - cy.contains(text).should('exist') - }); +Then(/^Text should exist (?:'|")(.*?)(?:'|")$/, (text) => { +cy.contains(text).should('exist') +}); - Given(/^I navigate to the (?:'|")(.*?)(?:'|") page$/, page => { - cy.fixture("config.json").then((data) => { - cy.log('loginUrl = ' + data.loginUrl) - cy.log('page = ' + page) - cy.visit(data.loginUrl + '/' + page) - }) - cy.get(1000) - }); +Given(/^I navigate to the (?:'|")(.*?)(?:'|") page$/, page => { +cy.fixture("config.json").then((data) => { + cy.log('loginUrl = ' + data.loginUrl) + cy.log('page = ' + page) + cy.visit(data.loginUrl + '/' + page) +}) +cy.get(1000) +});