Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-T571 Integration search gives feed back when there are no results. #6922

Merged
merged 21 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cabf407
Merge pull request #1 from mattermost/master
MikeworX Sep 14, 2020
019f4e5
Merge branch 'master' of https://github.com/mattermost/mattermost-webapp
Sep 14, 2020
4ff9063
Merge branch 'master' of https://github.com/mattermost/mattermost-webapp
MikeworX Sep 29, 2020
be00b61
Merge branch 'master' of https://github.com/mattermost/mattermost-webapp
MikeworX Sep 30, 2020
204c51e
Merge branch 'master' of https://github.com/MikeworX/mattermost-webapp
MikeworX Oct 13, 2020
ce273a4
Merge remote-tracking branch 'upstream/master'
MikeworX Oct 19, 2020
af449a0
Merge remote-tracking branch 'upstream/master'
MikeworX Oct 20, 2020
5bd4662
Merge remote-tracking branch 'upstream/master'
MikeworX Oct 21, 2020
6bc2ee2
Merge remote-tracking branch 'upstream/master'
MikeworX Oct 21, 2020
80a5268
wip
MikeworX Oct 22, 2020
3d0be14
wip
MikeworX Oct 23, 2020
3773b0f
done
MikeworX Oct 26, 2020
47b968a
Delete only_public_channels_available_in_webhook_spec.js
MikeworX Oct 26, 2020
1c52a86
additional checks
MikeworX Oct 26, 2020
4512a34
Merge branch 'integration_search_feedback' of https://github.com/Mike…
MikeworX Oct 26, 2020
479d1f1
Merge branch 'master' into integration_search_feedback
mattermod Oct 27, 2020
e4d04d4
refactor
MikeworX Oct 27, 2020
8c9689b
Merge branch 'integration_search_feedback' of https://github.com/Mike…
MikeworX Oct 27, 2020
a445982
refactor
MikeworX Oct 27, 2020
f351cf5
lint fix
MikeworX Oct 27, 2020
fa93e4d
fix after refactor
MikeworX Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
additional checks
  • Loading branch information
MikeworX committed Oct 26, 2020
commit 1c52a86df64f9505ec10f13c1f1b1492bcf7146b
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,120 @@

// Group: @integrations

import {getRandomId} from '../../utils';

describe('Integrations', () => {
let teamA;
const searchterm = 'abcde';
let teamName;
const results = 'Test';
const noResults = `${getRandomId(10)}`;
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

before(() => {
// # Setup with the new team
cy.apiInitSetup().then(({team}) => {
teamA = team.name;
// # Setup with the new team and channel
cy.apiInitSetup().then(({team, channel}) => {
teamName = team.name;

// # Setup 2 incoming webhooks
const newIncomingHook1 = {
channel_id: channel.id,
description: 'Incoming webhook Test Description One',
display_name: 'Test 1',
};
cy.apiCreateWebhook(newIncomingHook1);

const newIncomingHook2 = {
channel_id: channel.id,
description: 'Incoming webhook Test Description Two',
display_name: 'Test 2',
};
cy.apiCreateWebhook(newIncomingHook2);
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

// # Setup 2 outgoing webhooks
const newOutgoingHook1 = {
team_id: team.id,
display_name: 'Test 1',
trigger_words: ['banana'],
callback_urls: ['https://mattermost.com'],
};
cy.apiCreateWebhook(newOutgoingHook1, false);
const newOutgoingHook2 = {
team_id: team.id,
display_name: 'Test 2',
trigger_words: ['apple'],
callback_urls: ['https://mattermost.com'],
};
cy.apiCreateWebhook(newOutgoingHook2, false);
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

// # Setup 2 Slash Commands
const slashCommand1 = {
description: 'Test Slash Command 1',
display_name: 'Test 1',
method: 'P',
team_id: team.id,
trigger: 'search-test',
url: 'https://google.com',
};
cy.apiCreateCommand(slashCommand1);
const slashCommand2 = {
description: 'Test Slash Command 2',
display_name: 'Test 2',
method: 'P',
team_id: team.id,
trigger: 'search-testsfds',
url: 'https://google.com',
};
cy.apiCreateCommand(slashCommand2);
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

// # Setup 2 bot accounts
const botName1 = `${getRandomId(6)}`;
const botName2 = `${getRandomId(6)}`;
cy.visit(`/${teamName}/integrations/bots/add`);
cy.get('#username').type(`Test1-${botName1}`);
cy.get('#saveBot').click();
cy.get('#doneButton').click();
cy.visit(`/${teamName}/integrations/bots/add`);
cy.get('#username').type(`Test2-${botName2}`);
cy.get('#saveBot').click();
cy.get('#doneButton').click();
MikeworX marked this conversation as resolved.
Show resolved Hide resolved
});
});

it('MM-T571 Integration search gives feed back when there are no results', () => {
// # Visit the integrations page
cy.visit(`/${teamA}/integrations`);
cy.visit(`/${teamName}/integrations`);
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

// # Shrink the page
cy.viewport(300, 500);
MikeworX marked this conversation as resolved.
Show resolved Hide resolved

// * Check incoming webhooks for no match message
cy.get('#incomingWebhooks').click();
cy.get('#searchInput').type(searchterm);
cy.get('#emptySearchResultsMessage').contains(`No incoming webhooks match ${searchterm}`);
cy.get('#searchInput').type(results).then(() => {
cy.get('#emptySearchResultsMessage').should('not.exist');
});
cy.get('#searchInput').clear().type(noResults);
cy.get('#emptySearchResultsMessage').contains(`No incoming webhooks match ${noResults}`);

// * Check outgoing webhooks for no match message
cy.get('#outgoingWebhooks').click();
cy.get('#searchInput').clear().type(searchterm);
cy.get('#emptySearchResultsMessage').contains(`No outgoing webhooks match ${searchterm}`);
cy.get('#searchInput').type(results).then(() => {
cy.get('#emptySearchResultsMessage').should('not.exist');
});
cy.get('#searchInput').clear().type(noResults);
cy.get('#emptySearchResultsMessage').contains(`No outgoing webhooks match ${noResults}`);

// * Check slash commands for no match message
cy.get('#slashCommands').click();
cy.get('#searchInput').clear().type(searchterm);
cy.get('#emptySearchResultsMessage').contains(`No commands match ${searchterm}`);
cy.get('#searchInput').type(results).then(() => {
cy.get('#emptySearchResultsMessage').should('not.exist');
});
cy.get('#searchInput').clear().type(noResults);
cy.get('#emptySearchResultsMessage').contains(`No commands match ${noResults}`);

// * Check bot accounts for no match message
cy.get('#botAccounts').click();
cy.get('#searchInput').clear().type(searchterm);
cy.get('#emptySearchResultsMessage').contains(`No bot accounts match ${searchterm}`);
cy.get('#searchInput').type(results).then(() => {
cy.get('#emptySearchResultsMessage').should('not.exist');
MikeworX marked this conversation as resolved.
Show resolved Hide resolved
});
cy.get('#searchInput').clear().type(noResults);
cy.get('#emptySearchResultsMessage').contains(`No bot accounts match ${noResults}`);
});
});

This file was deleted.