2023-04-12 01:29:44 +03:00
|
|
|
import { resolve } from 'node:path';
|
|
|
|
|
2023-03-27 07:04:03 +03:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
|
|
|
import { openHomePage } from '../libs/load-page';
|
2023-03-28 08:25:16 +03:00
|
|
|
import { waitMarkdownImported } from '../libs/page-logic';
|
2023-03-27 07:04:03 +03:00
|
|
|
import { test } from '../libs/playwright';
|
|
|
|
import { clickSideBarSettingButton } from '../libs/sidebar';
|
2023-04-12 01:29:44 +03:00
|
|
|
import { testResultDir } from '../libs/utils';
|
2023-03-27 07:04:03 +03:00
|
|
|
|
|
|
|
test.describe('Local first setting page', () => {
|
|
|
|
test('Should highlight the setting page menu when selected', async ({
|
|
|
|
page,
|
|
|
|
}) => {
|
|
|
|
await openHomePage(page);
|
2023-03-28 08:25:16 +03:00
|
|
|
await waitMarkdownImported(page);
|
2023-03-27 07:04:03 +03:00
|
|
|
const element = await page.getByTestId(
|
|
|
|
'slider-bar-workspace-setting-button'
|
|
|
|
);
|
2023-04-12 01:29:44 +03:00
|
|
|
const prev = await element.screenshot({
|
|
|
|
path: resolve(
|
|
|
|
testResultDir,
|
|
|
|
'slider-bar-workspace-setting-button-prev.png'
|
|
|
|
),
|
|
|
|
});
|
2023-03-27 07:04:03 +03:00
|
|
|
await clickSideBarSettingButton(page);
|
2023-04-12 01:29:44 +03:00
|
|
|
await page.waitForTimeout(50);
|
|
|
|
const after = await element.screenshot({
|
|
|
|
path: resolve(
|
|
|
|
testResultDir,
|
|
|
|
'slider-bar-workspace-setting-button-after.png'
|
|
|
|
),
|
|
|
|
});
|
|
|
|
expect(prev).not.toEqual(after);
|
2023-03-27 07:04:03 +03:00
|
|
|
});
|
|
|
|
});
|