forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-T616 Copy icon for Outgoing Webhook token (mattermost#6880)
Co-authored-by: Mattermost <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
e2e/cypress/integration/integrations/outgoing_webhook/token_copy_icon_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
// *************************************************************** | ||
// - [#] indicates a test step (e.g. # Go to a page) | ||
// - [*] indicates an assertion (e.g. * Check the title) | ||
// - Use element ID when selecting an element. Create one if none. | ||
// *************************************************************** | ||
|
||
// Group: @integrations | ||
|
||
describe('Integrations', () => { | ||
let testTeam; | ||
let testChannel; | ||
|
||
before(() => { | ||
// # Create test team and channel | ||
cy.apiInitSetup().then(({team, channel}) => { | ||
testTeam = team.name; | ||
testChannel = channel.display_name; | ||
}); | ||
}); | ||
|
||
it('MM-T616 Copy icon for Outgoing Webhook token', () => { | ||
// Visit the integrations > add page | ||
cy.visit(`/${testTeam}/integrations/outgoing_webhooks/add`); | ||
|
||
// * Assert that we are on the add page | ||
cy.url().should('include', '/outgoing_webhooks/add'); | ||
|
||
// # Manually set up an outgoing web-hook | ||
cy.get('#displayName').type('test'); | ||
cy.get('#channelSelect').select(testChannel); | ||
cy.get('#triggerWords').type('trigger'); | ||
cy.get('#callbackUrls').type('https://mattermost.com'); | ||
cy.findByText('Save').click(); | ||
|
||
// Assert that webhook was set up | ||
cy.findByText('Setup Successful').should('be.visible'); | ||
|
||
// * Assert that token copy icon is present | ||
cy.findByTestId('copyText').should('be.visible'); | ||
|
||
// # Close the add outgoing webhooks page | ||
cy.findByText('Done').click(); | ||
|
||
// * Assert that we are back on the integrations > outgoing webhooks page | ||
cy.get('#addOutgoingWebhook').should('exist'); | ||
|
||
// * Assert that the copy icon is present | ||
cy.findByTestId('copyText').should('be.visible'); | ||
}); | ||
}); |