-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project import generated by Copybara
PiperOrigin-RevId: 722886535
- Loading branch information
1 parent
a9248fe
commit 28ecf8a
Showing
40 changed files
with
438 additions
and
172 deletions.
There are no files selected for viewing
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
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
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 modified
BIN
+1.18 KB
(100%)
...rator.spec.ts-snapshots/samplePrepopulate-bottom-anchor-slot-chromium-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 modified
BIN
+2.2 KB
(100%)
...urator.spec.ts-snapshots/samplePrepopulate-bottom-anchor-slot-firefox-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 modified
BIN
+905 Bytes
(100%)
...gurator.spec.ts-snapshots/samplePrepopulate-bottom-anchor-slot-webkit-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 modified
BIN
+1.02 KB
(100%)
...urator.spec.ts-snapshots/samplePrepopulate-interstitial-slot-chromium-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 modified
BIN
+2.05 KB
(100%)
...gurator.spec.ts-snapshots/samplePrepopulate-interstitial-slot-firefox-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 modified
BIN
+835 Bytes
(100%)
...igurator.spec.ts-snapshots/samplePrepopulate-interstitial-slot-webkit-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 modified
BIN
+2.25 KB
(100%)
...igurator.spec.ts-snapshots/samplePrepopulate-multi-size-slot-chromium-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 modified
BIN
+5.01 KB
(100%)
...figurator.spec.ts-snapshots/samplePrepopulate-multi-size-slot-firefox-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 modified
BIN
+2.79 KB
(100%)
...nfigurator.spec.ts-snapshots/samplePrepopulate-multi-size-slot-webkit-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 modified
BIN
+1.61 KB
(100%)
...figurator.spec.ts-snapshots/samplePrepopulate-page-targeting-chromium-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 modified
BIN
+1.37 KB
(100%)
...nfigurator.spec.ts-snapshots/samplePrepopulate-page-targeting-firefox-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 modified
BIN
+704 Bytes
(100%)
...onfigurator.spec.ts-snapshots/samplePrepopulate-page-targeting-webkit-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 modified
BIN
+1.55 KB
(100%)
...tor.spec.ts-snapshots/samplePrepopulate-privacy-settings-all-chromium-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 modified
BIN
+1.39 KB
(100%)
...ator.spec.ts-snapshots/samplePrepopulate-privacy-settings-all-firefox-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 modified
BIN
+766 Bytes
(100%)
...rator.spec.ts-snapshots/samplePrepopulate-privacy-settings-all-webkit-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 modified
BIN
+1.54 KB
(100%)
...gurator.spec.ts-snapshots/samplePrepopulate-privacy-settings-chromium-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 modified
BIN
+1.32 KB
(100%)
...igurator.spec.ts-snapshots/samplePrepopulate-privacy-settings-firefox-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 modified
BIN
+652 Bytes
(100%)
...figurator.spec.ts-snapshots/samplePrepopulate-privacy-settings-webkit-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 modified
BIN
+2.21 KB
(100%)
...configurator.spec.ts-snapshots/samplePrepopulate-single-slot-chromium-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 modified
BIN
+5.09 KB
(110%)
.../configurator.spec.ts-snapshots/samplePrepopulate-single-slot-firefox-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 modified
BIN
+2.89 KB
(100%)
...b/configurator.spec.ts-snapshots/samplePrepopulate-single-slot-webkit-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 modified
BIN
+1.58 KB
(100%)
...figurator.spec.ts-snapshots/samplePrepopulate-slot-targeting-chromium-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 modified
BIN
+1.38 KB
(100%)
...nfigurator.spec.ts-snapshots/samplePrepopulate-slot-targeting-firefox-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 modified
BIN
+944 Bytes
(100%)
...onfigurator.spec.ts-snapshots/samplePrepopulate-slot-targeting-webkit-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 modified
BIN
+3.32 KB
(100%)
...onfigurator.spec.ts-snapshots/samplePrepopulate-sra-disabled-chromium-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 modified
BIN
+6.23 KB
(110%)
...configurator.spec.ts-snapshots/samplePrepopulate-sra-disabled-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+3.99 KB
(100%)
.../configurator.spec.ts-snapshots/samplePrepopulate-sra-disabled-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
+3.31 KB
(100%)
...configurator.spec.ts-snapshots/samplePrepopulate-sra-enabled-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+6.21 KB
(110%)
.../configurator.spec.ts-snapshots/samplePrepopulate-sra-enabled-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+3.95 KB
(100%)
...b/configurator.spec.ts-snapshots/samplePrepopulate-sra-enabled-webkit-linux.png
Oops, something went wrong.
Binary file modified
BIN
+989 Bytes
(100%)
...igurator.spec.ts-snapshots/samplePrepopulate-top-anchor-slot-chromium-linux.png
Oops, something went wrong.
Binary file modified
BIN
+2.12 KB
(100%)
...figurator.spec.ts-snapshots/samplePrepopulate-top-anchor-slot-firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+986 Bytes
(100%)
...nfigurator.spec.ts-snapshots/samplePrepopulate-top-anchor-slot-webkit-linux.png
Oops, something went wrong.
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,97 @@ | ||
/** | ||
* Copyright 2025 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import {expect, Locator} from '@playwright/test'; | ||
|
||
/** | ||
* Custom assertions for working with configurator elements in tests. | ||
*/ | ||
export const configuratorExpect = expect.extend({ | ||
/** | ||
* Ensures the {@link Locator} points to an enabled element. | ||
* | ||
* @param locator | ||
* @returns | ||
*/ | ||
async toBeEnabled(locator: Locator) { | ||
try { | ||
const tag = await locator.evaluate(elem => elem.tagName); | ||
await (tag.toLowerCase() === 'md-select-option' | ||
? expect(locator).not.toHaveAttribute('disabled', /.*/) | ||
: expect(locator).toBeEnabled()); | ||
|
||
return { | ||
pass: true, | ||
message: () => 'Expected element to be disabled, but it was enabled.', | ||
}; | ||
} catch (e) { | ||
return { | ||
pass: false, | ||
message: () => 'Expected element to be enabled, but it was disabled.', | ||
}; | ||
} | ||
}, | ||
|
||
/** | ||
* Ensures the {@link Locator} points to a disabled element. | ||
* | ||
* @param locator | ||
* @returns | ||
*/ | ||
async toBeDisabled(locator: Locator) { | ||
try { | ||
const tag = await locator.evaluate(elem => elem.tagName); | ||
await (tag.toLowerCase() === 'md-select-option' | ||
? expect(locator).toHaveAttribute('disabled', /.*/) | ||
: expect(locator).toBeDisabled()); | ||
|
||
return { | ||
pass: true, | ||
message: () => 'Expected element to be enabled, but it was disabled.', | ||
}; | ||
} catch (e) { | ||
return { | ||
pass: false, | ||
message: () => 'Expected element to be disabled, but it was enabled.', | ||
}; | ||
} | ||
}, | ||
|
||
/** | ||
* Ensures the {@link Locator} points to a selected option element. | ||
* | ||
* @param locator | ||
* @returns | ||
*/ | ||
async toBeSelected(locator: Locator) { | ||
try { | ||
expect((await locator.evaluate(elem => elem.tagName)).toLowerCase()).toBe( | ||
'md-select-option', | ||
); | ||
await expect(locator).toHaveAttribute('data-aria-selected', 'true'); | ||
|
||
return { | ||
pass: true, | ||
message: () => 'Expected option to be unselected, but it was selected.', | ||
}; | ||
} catch (e) { | ||
return { | ||
pass: false, | ||
message: () => 'Expected option to be selected, but it was unselected.', | ||
}; | ||
} | ||
}, | ||
}); |
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
Oops, something went wrong.