Skip to content

Commit

Permalink
Isolate snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Dec 29, 2023
1 parent debf362 commit 89b840b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ui-tests/test/styles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe('Citation styles support', () => {
expect(await stylesSelector.screenshot()).toMatchSnapshot(imageName);

Check failure on line 41 in ui-tests/test/styles.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

test/styles.spec.ts:34:7 › Citation styles support › show some styles after opening

1) test/styles.spec.ts:34:7 › Citation styles support › show some styles after opening ─────────── Error: Screenshot comparison failed: Expected an image 410px by 357px, received 410px by 341px. 12641 pixels (ratio 0.09 of all image pixels) are different. Expected: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test/styles.spec.ts-snapshots/styles-selector-shows-styles-on-open-linux.png Received: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test-results/test-styles-Citation-styles-support-show-some-styles-after-opening/styles-selector-shows-styles-on-open-actual.png Diff: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test-results/test-styles-Citation-styles-support-show-some-styles-after-opening/styles-selector-shows-styles-on-open-diff.png 39 | 40 | const imageName = 'styles-selector:shows-styles-on-open.png'; > 41 | expect(await stylesSelector.screenshot()).toMatchSnapshot(imageName); | ^ 42 | }); 43 | 44 | test('find relevant styles by long title', async ({ page }) => { at /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test/styles.spec.ts:41:47
});

test('find relevant styles', async ({ page }) => {
test('find relevant styles by long title', async ({ page }) => {
await page.click(CHANGE_STYLE_BUTTON);

const stylesSelector = page.locator(STYLES_SELECTOR);
Expand All @@ -58,13 +58,17 @@ test.describe('Citation styles support', () => {

const imageNature = 'styles-selector:search-for-nature.png';
expect(await stylesSelector.screenshot()).toMatchSnapshot(imageNature);

Check failure on line 60 in ui-tests/test/styles.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

test/styles.spec.ts:44:7 › Citation styles support › find relevant styles by long title

2) test/styles.spec.ts:44:7 › Citation styles support › find relevant styles by long title ─────── Error: Screenshot comparison failed: Expected an image 410px by 357px, received 410px by 356px. 4538 pixels (ratio 0.04 of all image pixels) are different. Expected: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test/styles.spec.ts-snapshots/styles-selector-search-for-nature-linux.png Received: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test-results/test-styles-Citation-styles-support-find-relevant-styles-by-long-title/styles-selector-search-for-nature-actual.png Diff: /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test-results/test-styles-Citation-styles-support-find-relevant-styles-by-long-title/styles-selector-search-for-nature-diff.png 58 | 59 | const imageNature = 'styles-selector:search-for-nature.png'; > 60 | expect(await stylesSelector.screenshot()).toMatchSnapshot(imageNature); | ^ 61 | }); 62 | 63 | test('find relevant styles by short title', async ({ page }) => { at /home/runner/work/jupyterlab-citation-manager/jupyterlab-citation-manager/ui-tests/test/styles.spec.ts:60:47
});

// remove "Nature"
for (const _letter of 'Nature') {
await input.press('Backspace');
}
test('find relevant styles by short title', async ({ page }) => {
await page.click(CHANGE_STYLE_BUTTON);

// test searching by short title:
const stylesSelector = page.locator(STYLES_SELECTOR);
await stylesSelector.waitFor();

await page.addStyleTag({ content: hideBlinkingCursorStyle });

const input = stylesSelector.locator('input.cm-SearchField');
await input.type('APA', { delay: 0 });
await stylesSelector
.locator('.cm-Option:nth-child(1):has-text("APA")')
Expand Down

0 comments on commit 89b840b

Please sign in to comment.