Files
48a3f4a0ab E2E/Cypress: Upgrade dependencies (#33665)
* upgrade cypress and other dependecies

* fix eslint

* remove axios-retry and update eslint

* fix tests

* fix lint on trailing spaces

---------

Co-authored-by: Mattermost Build <[email protected]>
2025-09-01 14:14:13 +08:00

35 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Team} from '@mattermost/types/teams';
import {getRandomId} from '../../../utils';
import * as TIMEOUTS from '../../../fixtures/timeouts';
export function createBotInteractive(team: Team, username = `bot-${getRandomId()}`) {
// # Visit the Integrations > Bot Accounts page
cy.visit(`/${team.name}/integrations/bots`);
// # Click add bot
cy.get('#addBotAccount').click();
// # Fill and submit form
cy.get('#username').type(username);
cy.get('#displayName').type('Test Bot');
cy.get('#saveBot').click();
// * Verify confirmation page
cy.url({timeout: TIMEOUTS.ONE_MIN}).
should('include', `/${team.name}/integrations/confirm`).
should('match', /token=[a-zA-Z0-9]{26}/);
// * Verify confirmation form/token
cy.get('div.backstage-form').
should('include.text', 'Setup Successful').
should((confirmation) => {
expect(confirmation.text()).to.match(/Token: [a-zA-Z0-9]{26}/);
});
return cy.get('div.backstage-form').invoke('text');
}