How can we set global styles for Stencil.js newE2EPage.
newE2EPage seems to have a addStyleTag
method. Is this a method we can use to set styles and if so how?
Yes, you can use page.addStyleTag
which actually comes from puppeteer (see https://pptr.dev/#?product=Puppeteer&version=master&show=api-pageaddstyletagoptions).
describe('Some Page', () => {
let page: E2EPage;
beforeEach(async () => {
page = await newE2EPage({ html: '<my-comp />' });
await page.addStyleUrl('/build/app.css'); // replace "app" with your namespace
});
});