Skip to content

Commit

Permalink
2.0 ordering capability channel and fixes to failures (#657)
Browse files Browse the repository at this point in the history
* 2.0 ordering capabilitites and test updates
* updated code as per failure
* added scrollIntoView for mustgather failure
---------
Signed-off-by: Ketul Shah <shah.ketul@ibm.com>
  • Loading branch information
ketulsha authored Mar 7, 2024
1 parent ad7ecfe commit f2deb47
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Feature: Create and Join a 2.x channel
And I provided 'channel2' for the 'Enter a name for your channel' input
And I clicked the button with title 'Select from available ordering services'
And I clicked the div with id 'downshift-0-item-0'
Then wait "3" seconds
And I clicked the span with text 'Next'
And I clicked the button with title 'Select MSP'
And I clicked the div with text 'Org1 MSP (org1msp)'
Expand All @@ -108,16 +109,38 @@ Feature: Create and Join a 2.x channel
And I clicked the span with text 'Next'
And I clicked the div with id 'selectedApplicationCapability'
And I clicked the div with text '2.0.0'
And I clicked the div with id 'selectedOrdererCapability'
And I clicked element with class '#selectedOrdererCapability > div > div:nth-child(2)'
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 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'
Then I clicked Create channel button
# And I clicked the button with text 'Create channel'
Then I should see a success toast with class '.bx--toast-notification__title' which says "You have successfully initiated a request to create channel2. Join a peer to this channel by clicking the pending channel tile below."
And the channel with name 'channel2' should have been created
Then wait "10" seconds
Then I should see a success toast with class '.bx--toast-notification__title' which says "You have successfully initiated a request to create channel2. This request requires the signature of an ordering service MSP. After the request has been signed and submitted, you will see a pending channel tile. Clicking on this tile will allow you to join a peer to the channel."
Then wait "5" seconds
# Approving New channel request
When I clicked the button with id 'ibp-header-signature-collection-icon'
And I clicked element with class '.ibp-signature-collection-notification-link'
Then wait "5" seconds
And I clicked the button with title 'Select identity to sign with'
And I clicked the div with text 'Ordering Service MSP Admin'
Then I clicked the button with id 'submit'
Then wait "5" seconds
When I clicked element with class '.ibp-signature-collection-notification-link'
Then wait "5" seconds
And I clicked the button with title 'Select MSP'
And I clicked the div with text 'Org2 MSP'
And I clicked the button with title 'Select an identity'
And I clicked the div with text 'Org2 MSP Admin'
Then I clicked the button with id 'submit'
Then wait "5" seconds
Then the element div with text 'channel2' should be visible on page

Scenario: When joining a channel (channel2)
And I am on the 'channels' page
Expand All @@ -127,3 +150,4 @@ Feature: Create and Join a 2.x channel
And I clicked the span with text 'Peer Org2'
When I clicked the button with id 'submit'
Then I should see a success toast with class '.bx--toast-notification__title' which says "You have successfully joined channel2."
Then the element div with text 'channel2' should be visible on page
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Feature: Build a network without system channel
And I provided 'channel5' for the 'Enter a name for your channel' input
And I clicked the button with title 'Select from available ordering services'
And I clicked the div with id 'downshift-0-item-0'
Then wait "5" seconds
And I clicked the span with text 'Next'
And I clicked the button with title 'Select MSP'
And I clicked the div with text 'Org1 MSP (org1msp)'
Expand All @@ -158,6 +159,8 @@ Feature: Build a network without system channel
And I clicked the span with text 'Next'
And I clicked the div with id 'selectedApplicationCapability'
And I clicked the div with text '2.0.0'
And I clicked the div with id 'selectedOrdererCapability'
And I clicked element with class '#selectedOrdererCapability > div > div:nth-child(2)'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
And I clicked the span with text 'Next'
Expand All @@ -172,6 +175,7 @@ Feature: Build a network without system channel
When I clicked the button with id 'submit'
Then wait "5" seconds
Then I should see a success toast with class '.bx--toast-notification__title' which says "You have successfully joined channel5."
Then wait "3" seconds

Scenario: Verify Orderer without system channel has joined channel
And I clicked the 'No_SysCh_OS' orderer
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo/test/cypress/e2e/features/12-AuditLog.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Feature: Verify Audit Log functionality works as expected
Then I should see audit log row with text 'updating channel "testchainid" - MSP "osmsp"' and id 'audit-logs-log_title-0'
Then I should see audit log row with text 'success' and id 'audit-logs-outcome_title-0'
# creating channel "channel2" - MSP "org1msp"
When I provided 'creating channel "channel2" - MSP "org1msp"' for input field with id "1"
Then I should see audit log row with text 'creating channel "channel2" - MSP "org1msp"' and id 'audit-logs-log_title-0'
When I provided 'creating channel "channel1" - MSP "org1msp"' for input field with id "1"
Then I should see audit log row with text 'creating channel "channel1" - MSP "org1msp"' and id 'audit-logs-log_title-0'
Then I should see audit log row with text 'success' and id 'audit-logs-outcome_title-0'
Then I reload the page
# peers"Peer Org1", "Peer Org2" havejoined the channel "channel2"
Expand Down
15 changes: 14 additions & 1 deletion packages/apollo/test/cypress/e2e/features/13-ConsoleAPI.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Feature: Verify Console APIs works as expected
Then I should see table with id "table-apikeys"
Then the element div with text 'managerAPIKey' should be visible on page


Scenario: Verify User can create new API key for writer and reader role
When I clicked the button with text 'Create an API key'
And I provided 'writerAPIKey' for the 'API key name' input
Expand Down Expand Up @@ -47,3 +46,17 @@ Feature: Verify Console APIs works as expected
And I clicked the button with id 'delete'
Then the element div with text 'There are no API keys yet' should be visible on page
Then I should see a success toast with class '.bx--toast-notification__title' which says "The selected API keys have been successfully removed."

Scenario: Search activity log for creating and deleting API key
When I clicked the div with id 'test__navigation--item--audit_logs'
Then I should see table with id 'table-audit_logs'
Then I should see div with id 'audit-logs'
And I provided 'creating api key' for input field with id "1"
Then I should see audit log row with text 'creating api key' and id 'audit-logs-log_title-0'
Then I should see audit log row with text 'POST:/api/v3/permissions/keys' and id 'audit-logs-api_title-0'
Then I should see audit log row with text 'success' and id 'audit-logs-outcome_title-0'
Then I reload the page
And I provided 'deleting api key' for input field with id "1"
Then I should see audit log row with text 'deleting api key' and id 'audit-logs-log_title-0'
Then I should see audit log row with text 'DELETE:/api/v3/permissions/{apikey}' and id 'audit-logs-api_title-0'
Then I should see audit log row with text 'success' and id 'audit-logs-outcome_title-0'
8 changes: 4 additions & 4 deletions packages/apollo/test/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Cypress.Commands.add('clickButton', (property, attributeValue) => {
try{
cy.wait(1000)
if (property == "text"){
cy.get('button').contains(attributeValue).click()
cy.get('button').contains(attributeValue).scrollIntoView().should('be.visible').click()
}else{
cy.get(`button[${property}="${attributeValue}"]`).click()
cy.get(`button[${property}="${attributeValue}"]`).scrollIntoView().should('be.visible').click()
}
}catch (err)
{
Expand All @@ -47,7 +47,7 @@ Cypress.Commands.add('clickButton', (property, attributeValue) => {
})

//Enter text into input / text field
Cypress.Commands.add('enterInput', (text, inputTitle) => {
Cypress.Commands.add('enterInput', (text, inputTitle) => {
try {
cy.wait(500)
cy.get(`input[title="${inputTitle}"]`).clear().type(text)
Expand All @@ -65,4 +65,4 @@ Cypress.Commands.add('selectDropdownOption', (item, dropdownSelector) => {
cy.log('Error: ', err)
}

})
})
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Given(/^the element (div|span) with text (?:'|")(.*?)(?:'|") should be visible o

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

Then(/^the table row with id (?:'|")(.*?)(?:'|") does not exist on page$/, value => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Then(/^I should see a success toast with class (?:'|")(.*?)(?:'|") which says (?
}
}
}else{
cy.get(className, { timeout: 60000 }).contains(expectedMessage).should('be.visible')
cy.get(className, { timeout: 180000 }).contains(expectedMessage).should('be.visible')
}
});

0 comments on commit f2deb47

Please sign in to comment.