-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(message): add screenshot tests using reusable test code (#948)
- Loading branch information
Showing
29 changed files
with
92 additions
and
29 deletions.
There are no files selected for viewing
28 changes: 22 additions & 6 deletions
28
packages/core/src/components/message/test/basic/message.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+5.11 KB
...-message-basic-primary-darkmode-is-basic-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.12 KB
...message-basic-primary-lightmode-is-basic-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.09 KB
...essage-basic-secondary-darkmode-is-basic-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+5.12 KB
...ic-message-rendered-correctly-1-linux.png → ...ic-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 22 additions & 8 deletions
30
packages/core/src/components/message/test/error/message.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-9.28 KB
....ts-snapshots/tds-message-error-is-error-message-rendered-correctly-1-linux.png
Binary file not shown.
Binary file added
BIN
+9.4 KB
...-message-error-primary-darkmode-is-error-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.29 KB
...message-error-primary-lightmode-is-error-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.37 KB
...essage-error-secondary-darkmode-is-error-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.3 KB
...ssage-error-secondary-lightmode-is-error-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions
21
packages/core/src/components/message/test/information/message.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { test } from 'stencil-playwright'; | ||
import { expect } from '@playwright/test'; | ||
import { | ||
testConfigurations, | ||
getTestDescribeText, | ||
setupPage, | ||
} from '../../../../utils/testConfiguration'; | ||
|
||
const componentTestPath = 'src/components/message/test/information/index.html'; | ||
const componentName = 'tds-message'; | ||
const testDescription = 'tds-message-information'; | ||
|
||
test.describe('tds-message-information', () => { | ||
test('is information message rendered correctly', async ({ page }) => { | ||
await page.goto(componentTestPath); | ||
testConfigurations.withModeVariants.forEach((config) => { | ||
test.describe.parallel(getTestDescribeText(config, testDescription), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await setupPage(page, config, componentTestPath, componentName); | ||
}); | ||
|
||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
test('is information message rendered correctly', async ({ page }) => { | ||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
}); | ||
}); | ||
}); |
Binary file removed
BIN
-9.36 KB
...s/tds-message-information-is-information-message-rendered-correctly-1-linux.png
Binary file not shown.
Binary file added
BIN
+9.4 KB
...ormation-primary-darkmode-is-information-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.36 KB
...rmation-primary-lightmode-is-information-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.38 KB
...mation-secondary-darkmode-is-information-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.25 KB
...ation-secondary-lightmode-is-information-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions
21
packages/core/src/components/message/test/success/message.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { test } from 'stencil-playwright'; | ||
import { expect } from '@playwright/test'; | ||
import { | ||
testConfigurations, | ||
getTestDescribeText, | ||
setupPage, | ||
} from '../../../../utils/testConfiguration'; | ||
|
||
const componentTestPath = 'src/components/message/test/success/index.html'; | ||
const componentName = 'tds-message'; | ||
const testDescription = 'tds-message-success'; | ||
|
||
test.describe('tds-message-success', () => { | ||
test('is success message rendered correctly', async ({ page }) => { | ||
await page.goto(componentTestPath); | ||
testConfigurations.withModeVariants.forEach((config) => { | ||
test.describe.parallel(getTestDescribeText(config, testDescription), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await setupPage(page, config, componentTestPath, componentName); | ||
}); | ||
|
||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
test('is success message rendered correctly', async ({ page }) => { | ||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
}); | ||
}); | ||
}); |
Binary file removed
BIN
-9.02 KB
...snapshots/tds-message-success-is-success-message-rendered-correctly-1-linux.png
Binary file not shown.
Binary file added
BIN
+9.07 KB
...sage-success-primary-darkmode-is-success-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.03 KB
...age-success-primary-lightmode-is-success-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.07 KB
...ge-success-secondary-darkmode-is-success-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.92 KB
...e-success-secondary-lightmode-is-success-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions
21
packages/core/src/components/message/test/warning/message.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { test } from 'stencil-playwright'; | ||
import { expect } from '@playwright/test'; | ||
import { | ||
testConfigurations, | ||
getTestDescribeText, | ||
setupPage, | ||
} from '../../../../utils/testConfiguration'; | ||
|
||
const componentTestPath = 'src/components/message/test/warning/index.html'; | ||
const componentName = 'tds-message'; | ||
const testDescription = 'tds-message-warning'; | ||
|
||
test.describe('tds-message-warning', () => { | ||
test('is warning message rendered correctly', async ({ page }) => { | ||
await page.goto(componentTestPath); | ||
testConfigurations.withModeVariants.forEach((config) => { | ||
test.describe.parallel(getTestDescribeText(config, testDescription), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await setupPage(page, config, componentTestPath, componentName); | ||
}); | ||
|
||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
test('is warning message rendered correctly', async ({ page }) => { | ||
/* Take screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
}); | ||
}); | ||
}); |
Binary file removed
BIN
-9.21 KB
...snapshots/tds-message-warning-is-warning-message-rendered-correctly-1-linux.png
Binary file not shown.
Binary file added
BIN
+9.29 KB
...sage-warning-primary-darkmode-is-warning-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.21 KB
...age-warning-primary-lightmode-is-warning-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.29 KB
...ge-warning-secondary-darkmode-is-warning-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.12 KB
...e-warning-secondary-lightmode-is-warning-message-rendered-correctly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.