-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(text-field): add screenshot tests using reusable test code (#956)
- Loading branch information
Showing
32 changed files
with
169 additions
and
63 deletions.
There are no files selected for viewing
35 changes: 25 additions & 10 deletions
35
packages/core/src/components/text-field/test/default/text-field.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.6 KB
...default-state-primary-darkmode-renders-default-text-field-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.42 KB
...efault-state-primary-lightmode-renders-default-text-field-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.57 KB
...fault-state-secondary-darkmode-renders-default-text-field-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.45 KB
...ault-state-secondary-lightmode-renders-default-text-field-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.
35 changes: 25 additions & 10 deletions
35
packages/core/src/components/text-field/test/disabled/text-field.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.34 KB
...efault-state-primary-darkmode-renders-disabled-text-field-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.52 KB
...-default-text-field-correctly-1-linux.png → ...disabled-text-field-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.27 KB
...ault-state-secondary-darkmode-renders-disabled-text-field-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.32 KB
...ult-state-secondary-lightmode-renders-disabled-text-field-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.
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 renamed
BIN
+5.28 KB
...disabled-text-field-correctly-1-linux.png → ...click-and-input-on-text-field-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
+4.97 KB
...with-error-state--12676--handle-hover-click-and-input-on-text-field-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
+6.09 KB
...th-error-state--30745-darkmode-renders-default-text-field-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
+6.1 KB
...th-error-state--77a59-darkmode-renders-default-text-field-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.97 KB
...th-error-state--9a284-ightmode-renders-default-text-field-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
+4.95 KB
...click-and-input-on-text-field-1-linux.png → ...click-and-input-on-text-field-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 KB
...with-error-state--b4450--handle-hover-click-and-input-on-text-field-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.99 KB
...th-error-state--bcdcf-ightmode-renders-default-text-field-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.
35 changes: 25 additions & 10 deletions
35
packages/core/src/components/text-field/test/read-only-success/text-field.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
+6.29 KB
...s-state-primary-18797-eadonly-success-state-of-text-field-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
+6.16 KB
...s-state-primary-7fe16-eadonly-success-state-of-text-field-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 removed
BIN
-6.21 KB
...uccess-state-renders-readonly-success-state-of-text-field-correctly-1-linux.png
Binary file not shown.
Binary file renamed
BIN
+5.97 KB
...-default-text-field-correctly-1-linux.png → ...state-of-text-field-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
+6.26 KB
...s-state-seconda-6d9f4-eadonly-success-state-of-text-field-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.
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
17 changes: 17 additions & 0 deletions
17
packages/core/src/components/text-field/test/with-helper-text/index.html
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Text Field - With helper text</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" /> | ||
<link rel="stylesheet" href="../../../../../dist/tegel/tegel.css" /> | ||
<script type="module"> | ||
import { defineCustomElements } from '../../../../../loader/index.es2017.js'; | ||
defineCustomElements(); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<tds-text-field placeholder="Placeholder" helper="Helper text"></tds-text-field> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
packages/core/src/components/text-field/test/with-helper-text/text-field.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { test } from 'stencil-playwright'; | ||
import { expect } from '@playwright/test'; | ||
import { | ||
testConfigurations, | ||
getTestDescribeText, | ||
setupPage, | ||
} from '../../../../utils/testConfiguration'; | ||
|
||
// Defined once for reuse | ||
const componentTestPath = 'src/components/text-field/test/with-helper-text/index.html'; | ||
const componentName = 'tds-text-field'; | ||
const testDescription = 'TdsTextField - with helper text'; | ||
|
||
testConfigurations.withModeVariants.forEach((config) => { | ||
test.describe.parallel(getTestDescribeText(config, testDescription), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await setupPage(page, config, componentTestPath, componentName); | ||
}); | ||
|
||
test('renders text-field with helper text', async ({ page }) => { | ||
/* Check diff on screenshot */ | ||
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+6.37 KB
...th-helper-text-primary-darkmode-renders-text-field-with-helper-text-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
+6.22 KB
...h-helper-text-primary-lightmode-renders-text-field-with-helper-text-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
+6.32 KB
...-helper-text-secondary-darkmode-renders-text-field-with-helper-text-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
+6.23 KB
...helper-text-secondary-lightmode-renders-text-field-with-helper-text-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.