Skip to content

Commit

Permalink
added testcase for 2.0 channel update (#566)
Browse files Browse the repository at this point in the history
Signed-off-by: Ketul Shah <[email protected]>
  • Loading branch information
ketulsha authored Nov 30, 2023
1 parent a1a64d8 commit 93552b1
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: 2.0 Lifecycle Flow
And I am logged in
And I am ready to get started

# Cypress launches new test runner / browser with clean state and that clears wallet that we store in browser local storage
# Cypress launches new test runner / browser with clean state and that clears wallet that we store in browser local storage
# https://github.com/cypress-io/cypress/issues/28186#issuecomment-1787344347
# Hence, we need to import required identities in begining of each feature file
Scenario: Setting up the identities
Expand Down Expand Up @@ -130,3 +130,53 @@ Feature: 2.0 Lifecycle Flow
And I clicked the div with text 'Org1 MSP Admin'
And I clicked the button with text 'Commit smart contract'
Then the chaincode with name 'fabcar' should have been created in 'Committed' state

Scenario: Updating channel2 as Org2
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 button with id 'channel2-sticky-settings-button'
And I clicked the button with title 'Select the MSP'
And I clicked the div with text 'Org2 MSP (org2msp)'
And I clicked the button with title 'Select an identity'
And I clicked the div with text 'Org2 MSP Admin'
Then wait "1" seconds
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I provided '13' for input field with id 'channelModal-block-params-absolute_max_bytes_mb-input-for-slider'
And I provided '510' for input field with id 'channelModal-block-params-max_message_count-input-for-slider'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the button with title 'Select the MSP'
And I clicked the div with text 'Ordering Service MSP (osmsp)'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Update channel'
Then I should see a success toast with class '.bx--toast-notification__title' which says 'You have successfully initiated a request to update channel channel2.'
# View channel configuration updates
When I clicked the button with id 'ibp-header-signature-collection-icon'
And I clicked element with class '.ibp-signature-collection-notification-link-text'
Then the element div with text 'Updated in channel configuration' should be visible on page
Then the element div with text 'Block cutting parameters' should be visible on page
And I clicked the button with id 'next'
And I clicked the button with title 'Select identity to sign with'
And I clicked the div with text 'Ordering Service MSP Admin'
And I clicked the button with id 'submit'
# Review and update channel configuration
And I clicked element with class '.ibp-signature-collection-notification-link-text'
Then the element div with text 'Updated in channel configuration' should be visible on page
Then the element div with text 'Block cutting parameters' should be visible on page
And I clicked the button with id 'next'
And I clicked the button with title 'Select MSP'
And I clicked the div with text 'Org2 MSP'
Then wait "1" seconds
And I clicked the button with title 'Select an identity'
And I clicked the div with text 'Org2 MSP Admin'
And I clicked the button with id 'submit'
Then the element div with text 'No approval notifications' should be visible on page
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,50 @@ Feature: Build a network without system channel
And I clicked the div with text 'Org1 MSP Admin'
And I clicked the button with text 'Commit smart contract'
Then the chaincode with name 'fabcar' should have been created in 'Committed' state

Scenario: Updating channel5 as Org2
And I am on the 'channels' page
And I clicked the div with id 'ibp-tile-channel5'
Then wait "5" seconds
And I clicked the button with id 'channel5-sticky-settings-button'
And I clicked the button with title 'Select the MSP'
And I clicked the div with text 'Org2 MSP (org2msp)'
And I clicked the button with title 'Select an identity'
And I clicked the div with text 'Org2 MSP Admin'
Then wait "1" seconds
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I provided '13' for input field with id 'channelModal-block-params-absolute_max_bytes_mb-input-for-slider'
And I provided '510' for input field with id 'channelModal-block-params-max_message_count-input-for-slider'
And I clicked the span with text 'Next'
And I clicked the button with title 'Select the MSP'
And I clicked the div with text 'Ordering Service MSP (osmsp)'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Update channel'
Then I should see a success toast with class '.bx--toast-notification__title' which says 'You have successfully initiated a request to update channel channel5.'
# View channel configuration updates
When I clicked the button with id 'ibp-header-signature-collection-icon'
And I clicked element with class '.ibp-signature-collection-notification-link-text'
Then the element div with text 'Updated in channel configuration' should be visible on page
Then the element div with text 'Block cutting parameters' should be visible on page
And I clicked the button with id 'next'
And I clicked the button with title 'Select identity to sign with'
And I clicked the div with text 'Ordering Service MSP Admin'
And I clicked the button with id 'submit'
# Review and update channel configuration
And I clicked element with class '.ibp-signature-collection-notification-link-text'
Then the element div with text 'Updated in channel configuration' should be visible on page
Then the element div with text 'Block cutting parameters' should be visible on page
And I clicked the button with id 'next'
And I clicked the button with title 'Select MSP'
And I clicked the div with text 'Org2 MSP'
Then wait "1" seconds
And I clicked the button with title 'Select an identity'
And I clicked the div with text 'Org2 MSP Admin'
And I clicked the button with id 'submit'
Then the element div with text 'No approval notifications' should be visible on page
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,13 @@ Then(/^the div with id (?:'|")(.*?)(?:'|") does not exist on page$/, value => {
cy.wait(1000)
cy.get(`div[id="${value}"]`).should('not.exist');
});

Given(/^the element (div|span) with text (?:'|")(.*?)(?:'|") should be visible on page$/, (property, value) => {
cy.wait(500)
cy.get(property).contains(value).should('be.visible')
});

Given(/^I clicked element with class (?:'|")(.*?)(?:'|")$/, (className) => {
cy.wait(500)
cy.get(className).should('be.visible').click()
});

0 comments on commit 93552b1

Please sign in to comment.