|
|
|
import { expect } from '@playwright/test';
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2 years ago
|
|
|
import { newUser } from './setup/new_user';
|
|
|
|
import { clickOnTestIdWithText } from './utilities/utils';
|
|
|
|
import { sessionTestOneWindow } from './setup/sessionTest';
|
|
|
|
|
|
|
|
sessionTestOneWindow('Switch themes', async ([windowA]) => {
|
|
|
|
// Create User
|
Adds data-testid to loading-animation, microphone recording button, recording permissions button, stop recording button, consolidates tests into user actions test, adds media to fixtures folder, updates linked device tests with avatar change, username change and group tests. Adds tests for messaging, sending image, video, document, gif and link with preview. Also updates reply message functionality to wait for loading animation
2 years ago
|
|
|
await newUser(windowA, 'Alice');
|
|
|
|
// Check light theme colour is correct
|
|
|
|
const darkThemeColor = windowA.locator('.inbox.index');
|
|
|
|
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
|
|
|
|
|
|
|
|
// Click theme button and change to dark theme
|
|
|
|
await clickOnTestIdWithText(windowA, 'theme-section');
|
|
|
|
// Check background colour of background to verify dark theme
|
|
|
|
const lightThemeColor = windowA.locator('.inbox.index');
|
|
|
|
await expect(lightThemeColor).toHaveCSS('background-color', 'rgb(255, 255, 255)');
|
|
|
|
|
|
|
|
// Toggle back to light theme
|
|
|
|
await clickOnTestIdWithText(windowA, 'theme-section');
|
|
|
|
// Check background colour again
|
|
|
|
await expect(darkThemeColor).toHaveCSS('background-color', 'rgb(27, 27, 27)');
|
|
|
|
});
|