Skip to content

Commit

Permalink
Update Puppeteer launch arguments to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Sep 15, 2023
1 parent 1ef16e9 commit 0061b24
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- run: node node_modules/puppeteer/install.js

- uses: actions/cache/restore@v3
with:
path: .
Expand Down
8 changes: 5 additions & 3 deletions end-to-end/access-an-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ describe('access an api', async () => {
});

it('should get an access token and access an api', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();

const clock = sinon.useFakeTimers({
Expand Down
16 changes: 10 additions & 6 deletions end-to-end/attempt-silent-login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ describe('attempt silent login', async () => {
});

it('should attempt silent login and swallow failures', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();
await goto(baseUrl, page);
await page.waitForNavigation();
Expand All @@ -43,9 +45,11 @@ describe('attempt silent login', async () => {
});

it('should login silently if there is an active session on the IDP', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();
await goto(`${baseUrl}/login`, page);
assert.match(
Expand Down
8 changes: 5 additions & 3 deletions end-to-end/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ describe('basic login and logout', async () => {
});

it('should login and logout with default configuration', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();
await goto(baseUrl, page);
assert.match(
Expand Down
8 changes: 5 additions & 3 deletions end-to-end/private-key-jwt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ describe('private key jwt', async () => {
});

it('should login with private key jwt client auth method', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();
await goto(baseUrl, page);
assert.match(page.url(), /http:\/\/localhost:3000/);
Expand Down
8 changes: 5 additions & 3 deletions end-to-end/userinfo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ describe('fetch userinfo', async () => {
});

it('should login with hybrid flow and fetch userinfo', async () => {
const browser = await puppeteer.launch({
args: ['no-sandbox', 'disable-setuid-sandbox'],
});
const args = puppeteer.defaultArgs();
args.set('--no-sandbox');
args.set('--disable-setuid-sandbox');

const browser = await puppeteer.launch(args);
const page = await browser.newPage();
await goto(baseUrl, page);
assert.match(
Expand Down

0 comments on commit 0061b24

Please sign in to comment.