Skip to content

Browserstack Accessibility support with WebdriverIO 🚀 #11064

Merged
christian-bromann merged 15 commits intowebdriverio:mainfrom
kamal-kaur04:browserstack-accessibility-support
Sep 12, 2023
Merged

Browserstack Accessibility support with WebdriverIO 🚀 #11064
christian-bromann merged 15 commits intowebdriverio:mainfrom
kamal-kaur04:browserstack-accessibility-support

Conversation

@kamal-kaur04
Copy link
Contributor

Proposed changes

BrowserStack Accessibility Automation Support to conduct accessibility testing on pre-existing test builds and generate health reports on BrowserStack

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@kamal-kaur04
Copy link
Contributor Author

kamal-kaur04 commented Aug 31, 2023

@christian-bromann Request your review on the above PR created against v8. Once the review finishes for this PR, will create a PR against v7 also.

Thanks!

@kamal-kaur04
Copy link
Contributor Author

@christian-bromann Thanks for the quick review. Have resolved most of the review comments.

}

export function accessibilityResultsSummary() {
return `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to return a string as it would remove all the code highlighting and prevents us from being able to test it. You can do this:

scripts.ts

export function accessibilityResultsSummary (paramA, paramB) {
  return new Promise(...
  // ...
}

in your service file:

import { accessibilityResultsSummary } from './scripts.js'

// ...
await browser.execute(accessibilityResultsSummary, paramA, paramB)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christian-bromann Could you please let me know, are you referring tests as lint tests or any other tests? Unit Tests don't seem to be feasible to test scripts. Any suggestions or thoughts here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit Tests don't seem to be feasible to test scripts

How so? Vitest allows running in JSDOM mode and we could even test the function in the browser using WebdriverIO itself 😉


if (!this.shouldRunTestHooks(this._browser, this._accessibility)) {
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


if (!this.shouldRunTestHooks(this._browser, this._accessibility)) {
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@kamal-kaur04
Copy link
Contributor Author

@christian-bromann Please check, have resolved most of the comments.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, lgtm 👍

@christian-bromann christian-bromann added the PR: New Feature 🚀 PRs that contain new features label Sep 12, 2023
@christian-bromann christian-bromann merged commit 3f38778 into webdriverio:main Sep 12, 2023
@kamal-kaur04
Copy link
Contributor Author

@christian-bromann Thanks for releasing the changes. Are these changes good to be raised against for WebDriverIO v7 branch as well?

@christian-bromann
Copy link
Member

Yes, but the v7 branch seems currently broken and I haven't had time to look into why.

@kamal-kaur04
Copy link
Contributor Author

Okay, when running unit tests, encountered an error. Is this known test failure? -

Details:

    /Users/kamalpreet/Documents/frameworks-core-forks/webdriverio/packages/wdio-sauce-service/node_modules/query-string/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import * as queryString from './base.js';
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1796:14)
      at Object.<anonymous> (packages/wdio-sauce-service/node_modules/saucelabs/build/index.js:13:43)

@christian-bromann
Copy link
Member

There is a known issue for this in the saucelabs dependency, we had to downgrade the saucelabs package version, see saucelabs/node-saucelabs#207. I think we have to do the same in v7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: New Feature 🚀 PRs that contain new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants