|
1 | 1 | import { expect, test } from '@playwright/test'; |
2 | 2 | import { NewtabPage } from './new-tab.page.js'; |
| 3 | +import { CustomizerPage } from '../app/customizer/integration-tests/customizer.page.js'; |
3 | 4 |
|
4 | 5 | test.describe('newtab widgets', () => { |
5 | 6 | test('widget config single click', async ({ page }, workerInfo) => { |
@@ -114,17 +115,37 @@ test.describe('newtab widgets', () => { |
114 | 115 | test('with overrides from initial setup (light)', async ({ page }, workerInfo) => { |
115 | 116 | const ntp = NewtabPage.create(page, workerInfo); |
116 | 117 | await ntp.reducedMotion(); |
117 | | - await ntp.openPage({ additional: { defaultStyles: 'visual-refresh' } }); |
| 118 | + await ntp.openPage({ additional: { defaultStyles: 'visual-refresh', customizerDrawer: 'enabled' } }); |
118 | 119 | await ntp.waitForCustomizer(); |
| 120 | + await page.pause(); |
119 | 121 | await ntp.hasBackgroundColor({ hex: '#E9EBEC' }); |
120 | 122 | }); |
121 | 123 | test('with overrides from initial setup (dark)', async ({ page }, workerInfo) => { |
122 | 124 | const ntp = NewtabPage.create(page, workerInfo); |
123 | 125 | await ntp.reducedMotion(); |
124 | 126 | await ntp.darkMode(); |
125 | | - await ntp.openPage({ additional: { defaultStyles: 'visual-refresh' } }); |
| 127 | + await ntp.openPage({ additional: { defaultStyles: 'visual-refresh', customizerDrawer: 'enabled' } }); |
126 | 128 | await ntp.waitForCustomizer(); |
127 | 129 | await ntp.hasBackgroundColor({ hex: '#27282A' }); |
128 | 130 | }); |
| 131 | + test('with pushed updated theme value (light)', async ({ page }, workerInfo) => { |
| 132 | + const ntp = NewtabPage.create(page, workerInfo); |
| 133 | + const cp = new CustomizerPage(ntp); |
| 134 | + await ntp.reducedMotion(); |
| 135 | + await ntp.openPage({}); |
| 136 | + await ntp.waitForCustomizer(); |
| 137 | + await cp.acceptsThemeUpdateWithDefaults('light', { darkBackgroundColor: '#000000', lightBackgroundColor: '#ffffff' }); |
| 138 | + await ntp.hasBackgroundColor({ hex: '#ffffff' }); |
| 139 | + }); |
| 140 | + test('with pushed updated theme value (dark)', async ({ page }, workerInfo) => { |
| 141 | + const ntp = NewtabPage.create(page, workerInfo); |
| 142 | + const cp = new CustomizerPage(ntp); |
| 143 | + await ntp.reducedMotion(); |
| 144 | + await ntp.darkMode(); |
| 145 | + await ntp.openPage({}); |
| 146 | + await ntp.waitForCustomizer(); |
| 147 | + await cp.acceptsThemeUpdateWithDefaults('dark', { darkBackgroundColor: '#000000', lightBackgroundColor: '#ffffff' }); |
| 148 | + await ntp.hasBackgroundColor({ hex: '#000000' }); |
| 149 | + }); |
129 | 150 | }); |
130 | 151 | }); |
0 commit comments