* refactor: convert bot_api_1_spec.js to typescript - convert file bot_accounts/bot_api_1_spec.js to typescript - update related data types in order to fix argument issues * refactor: convert bot_api_not_cloud_spec.js to ts - convert file bot_accounts/bot_api_not_cloud_spec.js to typescript - update related data types in order to fix argument issues * refactor: convert bot_channel_intro_spec.js to ts - convert file bot_accounts/bot_channel_intro_spec.js to typescript - convert support/api/bots.js to typescript - remove data type bot.d.ts and include docs and definitions in support/api/bots.ts * refactor: convert bot_accounts files to ts - convert files from js to typescript - move declaration files to ts - update js docs - fix lint and type errors Related to #21303 * fix: replace params undefined on client.createUser - replace undefined params with empty strings as suggested in review * fix: add types to variables on spec tags_spec.ts - add types to variables * fix: update args for apiCreateBot on api/bots.ts - update args so that lint issue is fixed * Apply suggestions from code review update assertion to 401 --------- Co-authored-by: Saturnino Abril <5334504+saturninoabril@users.noreply.github.com>
190 строки
4.6 KiB
TypeScript
190 строки
4.6 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
// ***************************************************************
|
|
// Each command should be properly documented using JSDoc.
|
|
// See https://jsdoc.app/index.html for reference.
|
|
// Basic requirements for documentation are the following:
|
|
// - Meaningful description
|
|
// - Each parameter with `@params`
|
|
// - Return value with `@returns`
|
|
// - Example usage with `@example`
|
|
// Custom command should follow naming convention of having `ui` prefix, e.g. `uiGetProductMenuButton`.
|
|
// ***************************************************************
|
|
|
|
declare namespace Cypress {
|
|
interface Chainable {
|
|
|
|
/**
|
|
* Get product switch button
|
|
*
|
|
* @example
|
|
* cy.uiGetProductMenuButton().click();
|
|
*/
|
|
uiGetProductMenuButton(): Chainable;
|
|
|
|
/**
|
|
* Get product switch menu
|
|
*
|
|
* @example
|
|
* cy.uiGetProductMenu().click();
|
|
*/
|
|
uiGetProductMenu(): Chainable;
|
|
|
|
/**
|
|
* Open product switch menu
|
|
*
|
|
* @param {string} item - menu item ex. System Console, Integrations, etc.
|
|
*
|
|
* @example
|
|
* cy.uiOpenProductMenu().click();
|
|
*/
|
|
uiOpenProductMenu(item: string = ''): Chainable;
|
|
|
|
/**
|
|
* Get set status button
|
|
*
|
|
* @example
|
|
* cy.uiGetSetStatusButton().click();
|
|
*/
|
|
uiGetSetStatusButton(): Chainable;
|
|
|
|
/**
|
|
* Get profile header
|
|
*
|
|
* @example
|
|
* cy.uiGetProfileHeader();
|
|
*/
|
|
uiGetProfileHeader(): Chainable;
|
|
|
|
/**
|
|
* Get status menu container
|
|
*
|
|
* @param {bool} option.exist - Set to false to not verify if the element exists. Otherwise, true (default) to check existence.
|
|
* @example
|
|
* cy.uiGetStatusMenuContainer({exist: false});
|
|
*/
|
|
uiGetStatusMenuContainer(option: Record<string, boolean>): Chainable;
|
|
|
|
/**
|
|
* Get user menu
|
|
*
|
|
* @example
|
|
* cy.uiGetStatusMenu();
|
|
*/
|
|
uiGetStatusMenu(): Chainable;
|
|
|
|
/**
|
|
* Open help menu
|
|
*
|
|
* @param {string} item - menu item ex. Ask the community, Help resources, etc.
|
|
*
|
|
* @example
|
|
* cy.uiOpenHelpMenu();
|
|
*/
|
|
uiOpenHelpMenu(item: string): Chainable;
|
|
|
|
/**
|
|
* Get help button
|
|
*
|
|
* @example
|
|
* cy.uiGetHelpButton();
|
|
*/
|
|
uiGetHelpButton(): Chainable;
|
|
|
|
/**
|
|
* Get help menu
|
|
*
|
|
* @example
|
|
* cy.uiGetHelpMenu();
|
|
*/
|
|
uiGetHelpMenu(): Chainable;
|
|
|
|
/**
|
|
* Open user menu
|
|
*
|
|
* @param {string} [item] - menu item ex. Profile, Logout, etc.
|
|
*
|
|
* @example
|
|
* cy.uiOpenUserMenu();
|
|
*/
|
|
uiOpenUserMenu(item?: string): Chainable;
|
|
|
|
/**
|
|
* Get search form container
|
|
*
|
|
* @example
|
|
* cy.uiGetSearchContainer();
|
|
*/
|
|
uiGetSearchContainer(): Chainable;
|
|
|
|
/**
|
|
* Get search box
|
|
*
|
|
* @example
|
|
* cy.uiGetSearchBox();
|
|
*/
|
|
uiGetSearchBox(): Chainable;
|
|
|
|
/**
|
|
* Get at-mention button
|
|
*
|
|
* @example
|
|
* cy.uiGetRecentMentionButton();
|
|
*/
|
|
uiGetRecentMentionButton(): Chainable;
|
|
|
|
/**
|
|
* Get saved posts button
|
|
*
|
|
* @example
|
|
* cy.uiGetSavedPostButton();
|
|
*/
|
|
uiGetSavedPostButton(): Chainable;
|
|
|
|
/**
|
|
* Get settings button
|
|
*
|
|
* @example
|
|
* cy.uiGetSettingsButton();
|
|
*/
|
|
uiGetSettingsButton(): Chainable;
|
|
|
|
/**
|
|
* Get settings modal
|
|
*
|
|
* @example
|
|
* cy.uiGetSettingsModal();
|
|
*/
|
|
uiGetSettingsModal(): Chainable;
|
|
|
|
/**
|
|
* Get channel info button
|
|
*
|
|
* @example
|
|
* cy.uiGetChannelInfoButton();
|
|
*/
|
|
uiGetChannelInfoButton(): Chainable;
|
|
|
|
/**
|
|
* Open settings modal
|
|
*
|
|
* @param {string} section - ex. Display, Sidebar, etc.
|
|
*
|
|
* @example
|
|
* cy.uiOpenSettingsModal();
|
|
*/
|
|
uiOpenSettingsModal(section: string): Chainable;
|
|
|
|
/**
|
|
* User log out via user menu
|
|
*
|
|
* @example
|
|
* cy.uiLogout();
|
|
*/
|
|
uiLogout(): Chainable;
|
|
}
|
|
}
|