superdesk/superdesk-client-core

View on GitHub
e2e/client/playwright/user-profile.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage
import {test, expect} from '@playwright/test';
import {restoreDatabaseSnapshot, s} from './utils';

test('switching system language', async ({page}) => {
    await restoreDatabaseSnapshot();
    await page.goto('/#/profile');

    await page.locator(s('my-profile')).click();
    await page.locator(s('my-profile-dropdown')).getByRole('link', {name: 'Manage profile'}).click();

    await expect(page.locator(s('page-title'))).toHaveText('My Profile');

    await page.locator(s('user-details-form')).getByLabel('Language').selectOption('Deutsch (German)');
    await page.locator(s('action-bar')).locator('[data-test-id="save"]').click();
    await page.getByRole('dialog').getByRole('button', {name: 'Confirm'}).click();

    // timeout needed due to page reload
    await expect(page.locator(s('page-title'))).toHaveText('Mein Profil', {timeout: 10000});
});