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

webdriverjs 4.7.3 broke default export in CJS #948

Closed
dequejenn opened this issue Nov 27, 2023 · 2 comments · Fixed by #943
Closed

webdriverjs 4.7.3 broke default export in CJS #948

dequejenn opened this issue Nov 27, 2023 · 2 comments · Fixed by #943
Assignees
Labels
in sprint Ticket is in current sprint PACKAGE: webdriverjs QA: required This ticket requires QA signoff signOff-QA

Comments

@dequejenn
Copy link
Contributor

dequejenn commented Nov 27, 2023

In v4.7.3 we released webdriverjs with a breaking change where we broke the default export and changed it to a .default export (in CJS). We need to fix this and go back to the default export, but since this is now released we also need to support the .default export so we don't break anyone using v4.7.3.

QA NOTES: We'll be supporting both default and .default exports in all our packages going forward, and some packages will also have a named export. Tests will need to be set up in both ESM and commonJS format to import / require (respectively) the default export and possibly named export, and in CJS require the .default export.

@dequejenn dequejenn added the in sprint Ticket is in current sprint label Nov 27, 2023
@dequejenn dequejenn added the QA: required This ticket requires QA signoff label Nov 27, 2023
@straker straker changed the title fix: allow cjs version of packages to export a default value webdriverjs 4.7.3 broke default export in CJS Nov 27, 2023
@padmavemulapati
Copy link

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

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();

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)

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();

Environment:

Label Value
Product axe-core/webdriverio
Version 4.8.3-6b60442.0
OS-Details _MAC- Intel Core i7 - 11.6.8 _
BrowserDetails Chrome 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 PACKAGE: webdriverjs QA: required This ticket requires QA signoff signOff-QA
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants