@@ -20,6 +20,12 @@ import { expect, test } from './fixtures';
2020// - No external requests
2121
2222test ( 'newtab page' , async ( { page, extensionId } ) => {
23+ await page . addInitScript ( ( ) => {
24+ const style = document . createElement ( 'style' ) ;
25+ style . textContent = "body { font-family: 'Noto Sans', Arial, sans-serif !important; }" ;
26+ document . head . appendChild ( style ) ;
27+ } ) ;
28+
2329 await page . goto ( `chrome-extension://${ extensionId } /newtab.html` ) ;
2430
2531 await expect ( page ) . toHaveTitle ( 'New Tab' ) ;
@@ -50,17 +56,20 @@ test('newtab page', async ({ page, extensionId }) => {
5056
5157 // TODO: More and better assertions.
5258
53- // console.log('Body font family:', getComputedStyle(document.body).fontFamily);
59+ // FIXME: Remove!!!!!!!
5460 const fontFamily = await page . evaluate ( ( ) => getComputedStyle ( document . body ) . fontFamily ) ;
5561 console . log ( 'Body font family:' , fontFamily ) ;
5662} ) ;
5763
5864test ( 'matches screenshot' , async ( { page, extensionId } ) => {
59- await page . goto ( `chrome-extension:// ${ extensionId } /newtab.html` ) ;
60- // await expect(page).toHaveScreenshot('newtab-default.png', { fullPage: true } );
61- await expect ( page ) . toHaveScreenshot ( 'newtab-default.png' , {
62- stylePath : [ 'test/e2e/screenshot.css' ] ,
65+ await page . addInitScript ( ( ) => {
66+ const style = document . createElement ( 'style' ) ;
67+ style . textContent = "body { font-family: 'Noto Sans', Arial, sans-serif !important; }" ;
68+ document . head . appendChild ( style ) ;
6369 } ) ;
70+
71+ await page . goto ( `chrome-extension://${ extensionId } /newtab.html` ) ;
72+ await expect ( page ) . toHaveScreenshot ( 'newtab-default.png' , { fullPage : true } ) ;
6473} ) ;
6574
6675test ( 'has no console calls or unhandled errors' , async ( { page, extensionId } ) => {
0 commit comments