[MM-46535] Fix E2E tests for reporting purposes (#2236)
This commit is contained in:
@@ -53,16 +53,12 @@ describe('Add Server Modal', function desc() {
|
||||
});
|
||||
|
||||
describe('MM-T4389 Invalid messages', () => {
|
||||
it('MM-T4389_1 should not be valid if no team name has been set', async () => {
|
||||
it('MM-T4389_1 should not be valid if no team name or URL has been set', async () => {
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
const existing = await newServerView.isVisible('#teamNameInput.is-invalid');
|
||||
existing.should.be.true;
|
||||
});
|
||||
|
||||
it('MM-T4389_2 should not be valid if no server address has been set', async () => {
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
const existing = await newServerView.isVisible('#teamUrlInput.is-invalid');
|
||||
existing.should.be.true;
|
||||
const existingName = await newServerView.isVisible('#teamNameInput.is-invalid');
|
||||
const existingUrl = await newServerView.isVisible('#teamUrlInput.is-invalid');
|
||||
existingName.should.be.true;
|
||||
existingUrl.should.be.true;
|
||||
});
|
||||
|
||||
it('should not be valid if a server with the same name exists', async () => {
|
||||
@@ -87,13 +83,12 @@ describe('Add Server Modal', function desc() {
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
});
|
||||
|
||||
it('MM-T4389_3 should not be marked invalid', async () => {
|
||||
const existing = await newServerView.isVisible('#teamNameInput.is-invalid');
|
||||
existing.should.be.false;
|
||||
});
|
||||
|
||||
it('MM-T4389_4 should not be possible to click save', async () => {
|
||||
it('MM-T4389_2 Name should not be marked invalid, URL should be marked invalid', async () => {
|
||||
const existingName = await newServerView.isVisible('#teamNameInput.is-invalid');
|
||||
const existingUrl = await newServerView.isVisible('#teamUrlInput.is-invalid');
|
||||
const disabled = await newServerView.getAttribute('#saveNewServerModal', 'disabled');
|
||||
existingName.should.be.false;
|
||||
existingUrl.should.be.true;
|
||||
(disabled === '').should.be.true;
|
||||
});
|
||||
});
|
||||
@@ -104,13 +99,12 @@ describe('Add Server Modal', function desc() {
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
});
|
||||
|
||||
it('MM-T4389_5 should be valid', async () => {
|
||||
const existing = await newServerView.isVisible('#teamUrlInput.is-invalid');
|
||||
existing.should.be.false;
|
||||
});
|
||||
|
||||
it('MM-T4389_6 should not be possible to click save', async () => {
|
||||
it('MM-T4389_3 URL should not be marked invalid, name should be marked invalid', async () => {
|
||||
const existingName = await newServerView.isVisible('#teamNameInput.is-invalid');
|
||||
const existingUrl = await newServerView.isVisible('#teamUrlInput.is-invalid');
|
||||
const disabled = await newServerView.getAttribute('#saveNewServerModal', 'disabled');
|
||||
existingName.should.be.true;
|
||||
existingUrl.should.be.false;
|
||||
(disabled === '').should.be.true;
|
||||
});
|
||||
});
|
||||
|
@@ -8,8 +8,6 @@ const env = require('../../modules/environment');
|
||||
const {asyncSleep} = require('../../modules/utils');
|
||||
|
||||
describe('server_management/drag_and_drop', function desc() {
|
||||
this.timeout(30000);
|
||||
|
||||
const config = {
|
||||
...env.demoConfig,
|
||||
teams: [
|
||||
@@ -40,107 +38,134 @@ describe('server_management/drag_and_drop', function desc() {
|
||||
],
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
const beforeFunc = async () => {
|
||||
env.createTestUserDataDir();
|
||||
env.cleanTestConfig();
|
||||
fs.writeFileSync(env.configFilePath, JSON.stringify(config));
|
||||
await asyncSleep(1000);
|
||||
this.app = await env.getApp();
|
||||
});
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
const afterFunc = async () => {
|
||||
if (this.app) {
|
||||
await this.app.close();
|
||||
}
|
||||
await env.clearElectronInstances();
|
||||
};
|
||||
|
||||
this.timeout(30000);
|
||||
|
||||
describe('MM-T2634 should be able to drag and drop servers in the dropdown menu', async () => {
|
||||
let mainWindow;
|
||||
let dropdownView;
|
||||
|
||||
before(async () => {
|
||||
await beforeFunc();
|
||||
mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
|
||||
await mainWindow.click('.TeamDropdownButton');
|
||||
});
|
||||
after(afterFunc);
|
||||
|
||||
it('MM-T2634_1 should appear the original order', async () => {
|
||||
const firstMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(1) .TeamDropdown__draggable-handle');
|
||||
const firstMenuItemText = await firstMenuItem.innerText();
|
||||
firstMenuItemText.should.equal('example');
|
||||
const secondMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(2) .TeamDropdown__draggable-handle');
|
||||
const secondMenuItemText = await secondMenuItem.innerText();
|
||||
secondMenuItemText.should.equal('github');
|
||||
const thirdMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(3) .TeamDropdown__draggable-handle');
|
||||
const thirdMenuItemText = await thirdMenuItem.innerText();
|
||||
thirdMenuItemText.should.equal('google');
|
||||
});
|
||||
|
||||
it('MM-T2634_2 after dragging the server down, should appear in the new order', async () => {
|
||||
// Move the first server down, then re-open the dropdown
|
||||
const initialMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(1) .TeamDropdown__draggable-handle');
|
||||
await initialMenuItem.focus();
|
||||
await dropdownView.keyboard.down(' ');
|
||||
await dropdownView.keyboard.down('ArrowDown');
|
||||
await dropdownView.keyboard.down(' ');
|
||||
await asyncSleep(1000);
|
||||
await mainWindow.keyboard.press('Escape');
|
||||
await mainWindow.click('.TeamDropdownButton');
|
||||
|
||||
// Verify that the new order persists
|
||||
const firstMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(1) .TeamDropdown__draggable-handle');
|
||||
const firstMenuItemText = await firstMenuItem.innerText();
|
||||
firstMenuItemText.should.equal('github');
|
||||
const secondMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(2) .TeamDropdown__draggable-handle');
|
||||
const secondMenuItemText = await secondMenuItem.innerText();
|
||||
secondMenuItemText.should.equal('example');
|
||||
const thirdMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(3) .TeamDropdown__draggable-handle');
|
||||
const thirdMenuItemText = await thirdMenuItem.innerText();
|
||||
thirdMenuItemText.should.equal('google');
|
||||
});
|
||||
|
||||
it('MM-T2634_3 should update the config file', () => {
|
||||
// Verify config is updated
|
||||
const newConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf-8'));
|
||||
const order0 = newConfig.teams.find((team) => team.name === 'github');
|
||||
order0.order.should.equal(0);
|
||||
const order1 = newConfig.teams.find((team) => team.name === 'example');
|
||||
order1.order.should.equal(1);
|
||||
const order2 = newConfig.teams.find((team) => team.name === 'google');
|
||||
order2.order.should.equal(2);
|
||||
});
|
||||
});
|
||||
|
||||
it('MM-T2634 should be able to drag and drop servers in the dropdown menu', async () => {
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
|
||||
await mainWindow.click('.TeamDropdownButton');
|
||||
describe('MM-T2635 should be able to drag and drop tabs', async () => {
|
||||
let mainWindow;
|
||||
before(async () => {
|
||||
await beforeFunc();
|
||||
mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
});
|
||||
after(afterFunc);
|
||||
|
||||
// Verify the original order
|
||||
let firstMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(1) .TeamDropdown__draggable-handle');
|
||||
let firstMenuItemText = await firstMenuItem.innerText();
|
||||
firstMenuItemText.should.equal('example');
|
||||
let secondMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(2) .TeamDropdown__draggable-handle');
|
||||
let secondMenuItemText = await secondMenuItem.innerText();
|
||||
secondMenuItemText.should.equal('github');
|
||||
let thirdMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(3) .TeamDropdown__draggable-handle');
|
||||
let thirdMenuItemText = await thirdMenuItem.innerText();
|
||||
thirdMenuItemText.should.equal('google');
|
||||
it('MM-T2635_1 should be in the original order', async () => {
|
||||
// Verify the original order
|
||||
const firstTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(1)');
|
||||
const firstTabText = await firstTab.innerText();
|
||||
firstTabText.should.equal('Channels');
|
||||
const secondTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(2)');
|
||||
const secondTabText = await secondTab.innerText();
|
||||
secondTabText.should.equal('Boards');
|
||||
const thirdTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(3)');
|
||||
const thirdTabText = await thirdTab.innerText();
|
||||
thirdTabText.should.equal('Playbooks');
|
||||
});
|
||||
|
||||
// Move the first server down, then re-open the dropdown
|
||||
await firstMenuItem.focus();
|
||||
await dropdownView.keyboard.down(' ');
|
||||
await dropdownView.keyboard.down('ArrowDown');
|
||||
await dropdownView.keyboard.down(' ');
|
||||
await asyncSleep(1000);
|
||||
await mainWindow.keyboard.press('Escape');
|
||||
await mainWindow.click('.TeamDropdownButton');
|
||||
it('MM-T2635_2 after moving the tab to the right, the tab should be in the new order', async () => {
|
||||
// Move the first tab to the right
|
||||
let firstTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(1)');
|
||||
await firstTab.focus();
|
||||
await mainWindow.keyboard.down(' ');
|
||||
await mainWindow.keyboard.down('ArrowRight');
|
||||
await mainWindow.keyboard.down(' ');
|
||||
await asyncSleep(1000);
|
||||
|
||||
// Verify that the new order persists
|
||||
firstMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(1) .TeamDropdown__draggable-handle');
|
||||
firstMenuItemText = await firstMenuItem.innerText();
|
||||
firstMenuItemText.should.equal('github');
|
||||
secondMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(2) .TeamDropdown__draggable-handle');
|
||||
secondMenuItemText = await secondMenuItem.innerText();
|
||||
secondMenuItemText.should.equal('example');
|
||||
thirdMenuItem = await dropdownView.waitForSelector('.TeamDropdown button.TeamDropdown__button:nth-child(3) .TeamDropdown__draggable-handle');
|
||||
thirdMenuItemText = await thirdMenuItem.innerText();
|
||||
thirdMenuItemText.should.equal('google');
|
||||
// Verify that the new order is visible
|
||||
firstTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(1)');
|
||||
const firstTabText = await firstTab.innerText();
|
||||
firstTabText.should.equal('Boards');
|
||||
const secondTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(2)');
|
||||
const secondTabText = await secondTab.innerText();
|
||||
secondTabText.should.equal('Channels');
|
||||
const thirdTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(3)');
|
||||
const thirdTabText = await thirdTab.innerText();
|
||||
thirdTabText.should.equal('Playbooks');
|
||||
});
|
||||
|
||||
// Verify config is updated
|
||||
const newConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf-8'));
|
||||
const order0 = newConfig.teams.find((team) => team.name === 'github');
|
||||
order0.order.should.equal(0);
|
||||
const order1 = newConfig.teams.find((team) => team.name === 'example');
|
||||
order1.order.should.equal(1);
|
||||
const order2 = newConfig.teams.find((team) => team.name === 'google');
|
||||
order2.order.should.equal(2);
|
||||
});
|
||||
|
||||
it('MM-T2635 should be able to drag and drop tabs', async () => {
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
|
||||
// Verify the original order
|
||||
let firstTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(1)');
|
||||
let firstTabText = await firstTab.innerText();
|
||||
firstTabText.should.equal('Channels');
|
||||
let secondTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(2)');
|
||||
let secondTabText = await secondTab.innerText();
|
||||
secondTabText.should.equal('Boards');
|
||||
let thirdTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(3)');
|
||||
let thirdTabText = await thirdTab.innerText();
|
||||
thirdTabText.should.equal('Playbooks');
|
||||
|
||||
// Move the first tab to the right
|
||||
await firstTab.focus();
|
||||
await mainWindow.keyboard.down(' ');
|
||||
await mainWindow.keyboard.down('ArrowRight');
|
||||
await mainWindow.keyboard.down(' ');
|
||||
await asyncSleep(1000);
|
||||
|
||||
// Verify that the new order is visible
|
||||
firstTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(1)');
|
||||
firstTabText = await firstTab.innerText();
|
||||
firstTabText.should.equal('Boards');
|
||||
secondTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(2)');
|
||||
secondTabText = await secondTab.innerText();
|
||||
secondTabText.should.equal('Channels');
|
||||
thirdTab = await mainWindow.waitForSelector('.TabBar li.teamTabItem:nth-child(3)');
|
||||
thirdTabText = await thirdTab.innerText();
|
||||
thirdTabText.should.equal('Playbooks');
|
||||
|
||||
// Verify config is updated
|
||||
const newConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf-8'));
|
||||
const firstTeam = newConfig.teams.find((team) => team.name === 'example');
|
||||
const order0 = firstTeam.tabs.find((tab) => tab.name === 'TAB_FOCALBOARD');
|
||||
order0.order.should.equal(0);
|
||||
const order1 = firstTeam.tabs.find((tab) => tab.name === 'TAB_MESSAGING');
|
||||
order1.order.should.equal(1);
|
||||
const order2 = firstTeam.tabs.find((tab) => tab.name === 'TAB_PLAYBOOKS');
|
||||
order2.order.should.equal(2);
|
||||
it('MM-T2635_3 should update the config file', () => {
|
||||
// Verify config is updated
|
||||
const newConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf-8'));
|
||||
const firstTeam = newConfig.teams.find((team) => team.name === 'example');
|
||||
const order0 = firstTeam.tabs.find((tab) => tab.name === 'TAB_FOCALBOARD');
|
||||
order0.order.should.equal(0);
|
||||
const order1 = firstTeam.tabs.find((tab) => tab.name === 'TAB_MESSAGING');
|
||||
order1.order.should.equal(1);
|
||||
const order2 = firstTeam.tabs.find((tab) => tab.name === 'TAB_PLAYBOOKS');
|
||||
order2.order.should.equal(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -11,38 +11,47 @@ const {asyncSleep} = require('../../modules/utils');
|
||||
describe('header', function desc() {
|
||||
this.timeout(30000);
|
||||
|
||||
beforeEach(async () => {
|
||||
env.createTestUserDataDir();
|
||||
env.cleanTestConfig();
|
||||
});
|
||||
describe('MM-T2637 Double-Clicking on the header should minimize/maximize the app', async () => {
|
||||
let header;
|
||||
let browserWindow;
|
||||
let initialBounds;
|
||||
|
||||
afterEach(async () => {
|
||||
if (this.app) {
|
||||
try {
|
||||
await this.app.close();
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (err) {}
|
||||
}
|
||||
await env.clearElectronInstances();
|
||||
});
|
||||
before(async () => {
|
||||
env.createTestUserDataDir();
|
||||
env.cleanTestConfig();
|
||||
initialBounds = {x: 0, y: 0, width: 800, height: 400, maximized: false};
|
||||
fs.writeFileSync(env.boundsInfoPath, JSON.stringify(initialBounds));
|
||||
this.app = await env.getApp();
|
||||
const mainWindow = await this.app.windows().find((window) => window.url().includes('index'));
|
||||
browserWindow = await this.app.browserWindow(mainWindow);
|
||||
header = await mainWindow.locator('div.topBar');
|
||||
});
|
||||
|
||||
it('MM-T2637 Double-Clicking on the header should minimize/maximize the app', async () => {
|
||||
const initialBounds = {x: 0, y: 0, width: 800, height: 400, maximized: false};
|
||||
fs.writeFileSync(env.boundsInfoPath, JSON.stringify(initialBounds));
|
||||
this.app = await env.getApp();
|
||||
const mainWindow = await this.app.windows().find((window) => window.url().includes('index'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
const header = await mainWindow.locator('div.topBar');
|
||||
const headerBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: headerBounds.width / 2, y: headerBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const isMaximized = await browserWindow.evaluate((window) => window.isMaximized());
|
||||
isMaximized.should.be.equal(true);
|
||||
const maximizedHeaderBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: maximizedHeaderBounds.width / 2, y: maximizedHeaderBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const revertedBounds = await browserWindow.evaluate((window) => window.getContentBounds());
|
||||
revertedBounds.height.should.be.equal(initialBounds.height);
|
||||
revertedBounds.width.should.be.equal(initialBounds.width);
|
||||
after(async () => {
|
||||
if (this.app) {
|
||||
try {
|
||||
await this.app.close();
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (err) {}
|
||||
}
|
||||
await env.clearElectronInstances();
|
||||
});
|
||||
|
||||
it('MM-T2637_1 should maximize on double-clicking the header', async () => {
|
||||
const headerBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: headerBounds.width / 2, y: headerBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const isMaximized = await browserWindow.evaluate((window) => window.isMaximized());
|
||||
isMaximized.should.be.equal(true);
|
||||
});
|
||||
|
||||
it('MM-T2637_2 should restore on double-clicking the header when maximized', async () => {
|
||||
const maximizedHeaderBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: maximizedHeaderBounds.width / 2, y: maximizedHeaderBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const revertedBounds = await browserWindow.evaluate((window) => window.getContentBounds());
|
||||
revertedBounds.height.should.be.equal(initialBounds.height);
|
||||
revertedBounds.width.should.be.equal(initialBounds.width);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -43,58 +43,35 @@ describe('LongServerName', function desc() {
|
||||
|
||||
let newServerView;
|
||||
|
||||
describe('MM-T4050 Long server name', () => {
|
||||
beforeEach(async () => {
|
||||
await newServerView.type('#teamNameInput', longServerName);
|
||||
await newServerView.type('#teamUrlInput', longServerUrl);
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
it('MM-T4050 Long server name', async () => {
|
||||
await newServerView.type('#teamNameInput', longServerName);
|
||||
await newServerView.type('#teamUrlInput', longServerUrl);
|
||||
await newServerView.click('#saveNewServerModal');
|
||||
|
||||
await asyncSleep(1000);
|
||||
const existing = Boolean(await this.app.windows().find((window) => window.url().includes('newServer')));
|
||||
existing.should.be.false;
|
||||
|
||||
const mainView = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
|
||||
|
||||
const isServerTabExists = Boolean(await mainView.locator(`text=${longServerName}`));
|
||||
const isServerAddedDropdown = Boolean(await dropdownView.locator(`text=${longServerName}`));
|
||||
isServerTabExists.should.be.true;
|
||||
isServerAddedDropdown.should.be.true;
|
||||
|
||||
const serverNameLocator = await mainView.locator(`text=${longServerName}`);
|
||||
|
||||
const isTruncated = await serverNameLocator.evaluate((element) => {
|
||||
return element.offsetWidth < element.scrollWidth;
|
||||
});
|
||||
isTruncated.should.be.true;
|
||||
|
||||
it('MM-T4050_1 should add new server tab', async () => {
|
||||
await asyncSleep(1000);
|
||||
const existing = Boolean(await this.app.windows().find((window) => window.url().includes('newServer')));
|
||||
existing.should.be.false;
|
||||
const isWithinMaxWidth = await serverNameLocator.evaluate((element) => {
|
||||
const width = parseFloat(window.getComputedStyle(element).getPropertyValue('width'));
|
||||
|
||||
const mainView = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
|
||||
|
||||
const isServerTabExists = Boolean(await mainView.locator(`text=${longServerName}`));
|
||||
const isServerAddedDropdown = Boolean(await dropdownView.locator(`text=${longServerName}`));
|
||||
|
||||
isServerTabExists.should.be.true;
|
||||
isServerAddedDropdown.should.be.true;
|
||||
});
|
||||
|
||||
it('MM-T4050_2 should truncate server name', async () => {
|
||||
await asyncSleep(1000);
|
||||
const existing = Boolean(await this.app.windows().find((window) => window.url().includes('newServer')));
|
||||
existing.should.be.false;
|
||||
|
||||
const mainView = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const serverNameLocator = await mainView.locator(`text=${longServerName}`);
|
||||
|
||||
const isTruncated = await serverNameLocator.evaluate((element) => {
|
||||
return element.offsetWidth < element.scrollWidth;
|
||||
});
|
||||
|
||||
isTruncated.should.be.true;
|
||||
});
|
||||
|
||||
it('MM-T4050_3 should display server tab with max width of 400px', async () => {
|
||||
await asyncSleep(1000);
|
||||
const existing = Boolean(await this.app.windows().find((window) => window.url().includes('newServer')));
|
||||
existing.should.be.false;
|
||||
|
||||
const mainView = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const serverNameLocator = await mainView.locator('.TeamDropdownButton');
|
||||
|
||||
const isWithinMaxWidth = await serverNameLocator.evaluate((element) => {
|
||||
const width = parseFloat(window.getComputedStyle(element).getPropertyValue('width'));
|
||||
|
||||
return width <= 400;
|
||||
});
|
||||
|
||||
isWithinMaxWidth.should.be.true;
|
||||
return width <= 400;
|
||||
});
|
||||
isWithinMaxWidth.should.be.true;
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user