Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default commonJs export #940

Closed
dequejenn opened this issue Nov 21, 2023 · 2 comments · Fixed by #927
Closed

Fix default commonJs export #940

dequejenn opened this issue Nov 21, 2023 · 2 comments · Fixed by #927
Assignees
Labels
in sprint Ticket is in current sprint QA: required This ticket requires QA signoff signOff-QA TYPE: prod bug Bug that was found internally in prod (not affecting customer currently)

Comments

@dequejenn
Copy link
Contributor

dequejenn commented Nov 21, 2023

In 4.7.3 we accidentally released a breaking change in the @axe-core/webdriverjs package by no longer having a default export. Need to add it back in so the following works:

const AxeBuilder = require('@axe-core/webdriverjs');
const WebDriver = require('selenium-webdriver');

const driver = new WebDriver.Builder().forBrowser('firefox').build();

driver.get('https://dequeuniversity.com/demo/mars/').then(() => {
  new AxeBuilder(driver).analyze((err, results) => {
    console.log(results);
  });
});

QA Notes: Ensure you can require the package using the default export without errors

@dequejenn dequejenn added TYPE: prod bug Bug that was found internally in prod (not affecting customer currently) in sprint Ticket is in current sprint QA: required This ticket requires QA signoff labels Nov 21, 2023
@padmavemulapati
Copy link

padmavemulapati commented Dec 5, 2023

Verified with the latest canary build (axe-core-npm_4.8.2-4af4d7d.0)

WebdriverJS
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/webdriverjs’); -
    test snippet:
await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitExport(driver).analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/webdriverjs’).default;

testSnippet:

await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new explicitExport(driver).analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/webdriverjs’); (or)Const AxeBuilder = require(‘@axe-core/webdriverjs’).AxeBuilder;

test snippet:

await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
 const results = await new AxeBuilder(driver).analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverjs'; -
    test snippet:
await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitExport(driver).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverjs';

test snippet:

await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
 const results = await new AxeBuilder(driver).analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverjs'; -
    test snippet:
await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitExport(driver).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverjs';

test snippet:

await driver.get('http://qateam.dequecloud.com/attest/api/test.html');
 const results = await new AxeBuilder(driver).analyze();
WebdriverIO
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/webdriverio’); -
    test snippet:
wait client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new implicitDefaultExport({client});
const results = await builder.analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/webdriverio’).default;

testSnippet:

await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/webdriverio’); (or)Const AxeBuilder = require(‘@axe-core/webdriverjs’).AxeBuilder;

test snippet:

await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverio'; -
    test snippet:
await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverio';

test snippet:

await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverio'; -
    test snippet:
await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverio';

test snippet:

await client.url('http://qateam.dequecloud.com/attest/api/test.html');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
Puppeteer
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/puppeteer’); -
    test snippet:
await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitDefaultExport(page).analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/puppeteer’).default;

testSnippet:

await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new explicitDefaultExport(page).analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/puppeteer’); (or)Const AxeBuilder = require(‘@axe-core/puppeteer’).AxeBuilder;

test snippet:

await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new AxeBuilder(page).analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/puppeteer'; -
    test snippet:
await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitDefaultExport(page).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/puppeteer';

test snippet:

await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new AxeBuilder(page).analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/puppeteer'; -
    test snippet:
await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new implicitDefaultExport(page).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/puppeteer';

test snippet:

await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
   const results = await new AxeBuilder(page).analyze();
Playwright
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/playwright’); -
    test snippet:
const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/playwright’).default;

testSnippet:

const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new explicitDefaultExport({ page }).analyze()
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/playwright’); (or)Const AxeBuilder = require(‘@axe-core/playwright’).AxeBuilder;

test snippet:

const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new AxeBuilder({ page }).analyze()
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/playwright'; -
    test snippet:
const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Named Export - import { AxeBuilder } from '@axe-core/playwright';

test snippet:

const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new AxeBuilder({ page }).analyze()
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/playwright'; -
    test snippet:
const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Named Export - import { AxeBuilder } from '@axe-core/playwright';

test snippet:

const page = await context.newPage();
  await page.goto('http://qateam.dequecloud.com/attest/api/test.html');
  const results = await new AxeBuilder({ page }).analyze()

Environment:

Label Value
Product axe-core/webdriverio
Version 4.8.2-4af4d7d.0
OS-Details _MAC- Intel Core i7 - 11.6.8 _
BrowserDetails Chrome Version 119.0.1 (Official Build) (64-bit)

@padmavemulapati
Copy link

Verified with the latest canary build (axe-core-npm_4.8.3-6b60442.0)

WebdriverJS
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/webdriverjs’); -
    test snippet:
await driver.get('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitExport(driver).analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/webdriverjs’).default;

testSnippet:

await driver.get('http://abcdcomputech.dequecloud.com/');
   const results = await new explicitExport(driver).analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/webdriverjs’); (or)Const AxeBuilder = require(‘@axe-core/webdriverjs’).AxeBuilder;

test snippet:

await driver.get('http://abcdcomputech.dequecloud.com/');
 const results = await new AxeBuilder(driver).analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverjs'; -
    test snippet:
await driver.get('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitExport(driver).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverjs';

test snippet:

await driver.get('http://abcdcomputech.dequecloud.com/');
 const results = await new AxeBuilder(driver).analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverjs'; -
    test snippet:
await driver.get('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitExport(driver).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverjs';

test snippet:

await driver.get('http://abcdcomputech.dequecloud.com/');
 const results = await new AxeBuilder(driver).analyze();
WebdriverIO
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/webdriverio’); -
    test snippet:
wait client.url('http://abcdcomputech.dequecloud.com/');
const builder = new implicitDefaultExport({client});
const results = await builder.analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/webdriverio’).default;

testSnippet:

await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/webdriverio’); (or)Const AxeBuilder = require(‘@axe-core/webdriverjs’).AxeBuilder;

test snippet:

await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverio'; -
    test snippet:
await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverio';

test snippet:

await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/webdriverio'; -
    test snippet:
await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new explicitDefaultExport({client});
const results = await builder.analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/webdriverio';

test snippet:

await client.url('http://abcdcomputech.dequecloud.com/');
const builder = new AxeBuilder({client});
const results = await builder.analyze();
Puppeteer
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/puppeteer’); -
    test snippet:
await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitDefaultExport(page).analyze();
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/puppeteer’).default;

testSnippet:

await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new explicitDefaultExport(page).analyze();
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/puppeteer’); (or)Const AxeBuilder = require(‘@axe-core/puppeteer’).AxeBuilder;

test snippet:

await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new AxeBuilder(page).analyze();
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/puppeteer'; -
    test snippet:
await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitDefaultExport(page).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/puppeteer';

test snippet:

await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new AxeBuilder(page).analyze();
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/puppeteer'; -
    test snippet:
await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new implicitDefaultExport(page).analyze();
  1. Named Export - import { AxeBuilder } from '@axe-core/puppeteer';

test snippet:

await page.goto('http://abcdcomputech.dequecloud.com/');
   const results = await new AxeBuilder(page).analyze();
Playwright
1. CJS
  1. Implicit Export - Const implicitDefaultExport = require(‘@axe-core/playwright’); -
    test snippet:
const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Explicit Export - Const explicitDefaultExport = require(‘@axe-core/playwright’).default;

testSnippet:

const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new explicitDefaultExport({ page }).analyze()
  1. Named Export - Const { AxeBuilder } = require(‘@axe-core/playwright’); (or)Const AxeBuilder = require(‘@axe-core/playwright’).AxeBuilder;

test snippet:

const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new AxeBuilder({ page }).analyze()
2. MJS
  1. Implicit Export - import AxeBuilder from '@axe-core/playwright'; -
    test snippet:
const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Named Export - import { AxeBuilder } from '@axe-core/playwright';

test snippet:

const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new AxeBuilder({ page }).analyze()
3. TS
  1. Implicit Export - import AxeBuilder from '@axe-core/playwright'; -
    test snippet:
const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new implicitDefaultExport({ page }).analyze()
  1. Named Export - import { AxeBuilder } from '@axe-core/playwright';

test snippet:

const page = await context.newPage();
  await page.goto('http://abcdcomputech.dequecloud.com/');
  const results = await new AxeBuilder({ page }).analyze()

Environment:

Label Value
Product axe-core/webdriverio
Version 4.8.3-6b60442.0
OS-Details _MAC- Intel Core i7 - 11.6.8 _
BrowserDetails CChrome Version 120.0.6099.129 & Firefox 121.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in sprint Ticket is in current sprint QA: required This ticket requires QA signoff signOff-QA TYPE: prod bug Bug that was found internally in prod (not affecting customer currently)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants