From 83f87451188cdf3b7214e95af021afb6f7967901 Mon Sep 17 00:00:00 2001 From: Michael Leonard Date: Wed, 14 Oct 2020 07:08:20 -0400 Subject: [PATCH] MM-T644 Integrations display on team where they were created (#6752) --- ...ions_display_on_team_where_created_spec.js | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 e2e/cypress/integration/integrations/incoming_webhook/integrations_display_on_team_where_created_spec.js diff --git a/e2e/cypress/integration/integrations/incoming_webhook/integrations_display_on_team_where_created_spec.js b/e2e/cypress/integration/integrations/incoming_webhook/integrations_display_on_team_where_created_spec.js new file mode 100644 index 000000000000..c23fad2ee717 --- /dev/null +++ b/e2e/cypress/integration/integrations/incoming_webhook/integrations_display_on_team_where_created_spec.js @@ -0,0 +1,56 @@ +// 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 teamA; + let teamB; + let newIncomingHook; + + before(() => { + // # Login, create incoming webhook for Team A + cy.apiInitSetup().then(({team, channel}) => { + teamA = team.name; + newIncomingHook = { + channel_id: channel.id, + display_name: 'Team A Webhook', + }; + + //# Create a new webhook for Team A + cy.apiCreateWebhook(newIncomingHook); + }); + + // # Login, create incoming webhook for Team B + cy.apiInitSetup().then(({team, channel}) => { + teamB = team.name; + newIncomingHook = { + channel_id: channel.id, + display_name: 'Team B Webhook', + }; + + // # Create a new webhook for Team B + cy.apiCreateWebhook(newIncomingHook); + }); + }); + + it('MM-T644 Integrations display on team where they were created', () => { + // # Visit Test Team B Incoming Webhooks page + cy.visit(`/${teamB}/integrations/incoming_webhooks`); + + // * Assert the page contains only Team B Outgoing Webhook + cy.findByText('Team', {exact: false}).contains('Team B Webhook').and('does.not.contain', 'Team A Webhook'); + + // # Visit Team A Incoming Webhooks page + cy.visit(`/${teamA}/integrations/incoming_webhooks`); + + // * Assert the page contains only Team A Outgoing Webhook + cy.findByText('Team', {exact: false}).contains('Team A Webhook').and('does.not.contain', 'Team B Webhook'); + }); +});