Skip to content

[v8] Accessibility targeted scans#5

Open
Bhargavi-BS wants to merge 24 commits intov8from
SDK-3984
Open

[v8] Accessibility targeted scans#5
Bhargavi-BS wants to merge 24 commits intov8from
SDK-3984

Conversation

@Bhargavi-BS
Copy link
Copy Markdown
Owner

Proposed changes

Types of changes

  • Polish (an improvement for an existing feature)
  • 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 (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

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 the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

Comment on lines +111 to +113
if (!this.accessibility || !this.isAppAccessibility){
return
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this change needed?

Copy link
Copy Markdown
Owner Author

@Bhargavi-BS Bhargavi-BS Sep 16, 2025

Choose a reason for hiding this comment

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

@AdityaHirapara for ally platform validation. If the test with startAllyScanning function is running for both edge and chrome, it will give the following error with edge ( startAllyScanning not found ) as accessibility module will not not work for edge.

dandonarahul2002 and others added 4 commits September 16, 2025 19:15
* fix: session name marking for browserstack-service via jasmine

* fix: use sessionName from userCaps for Jasmine

* chore: remove semicolon
Comment on lines +481 to +495
public async _setAnnotation(message: string) {
const autoInstance: AutomationFrameworkInstance = AutomationFramework.getTrackedInstance()
const browser = AutomationFramework.getDriver(autoInstance) as WebdriverIO.Browser

if (this.accessibility && isBrowserstackSession(browser)) {
await (browser as WebdriverIO.Browser).execute(`browserstack_executor: ${JSON.stringify({
action: 'annotate',
arguments: {
data: message,
level: 'info'
}
})}`)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The _setAnnotation function is already present in the packages/wdio-browserstack-service/src/accessibility-handler.ts file. Please move this function to a utilities instead of creating a new function in this file.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed

Comment on lines 472 to +474
private async _setAnnotation(message: string) {
if (this._accessibility && isBrowserstackSession(this._browser)) {
await (this._browser as WebdriverIO.Browser).execute(`browserstack_executor: ${JSON.stringify({
action: 'annotate',
arguments: {
data: message,
level: 'info'
}
})}`)
}
await setBrowserstackAnnotation(this._browser as WebdriverIO.Browser, message, Boolean(this._accessibility))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we directly call setBrowserstackAnnotation function instead of calling _setAnnotation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is to keep the approach similar in both the files where it is used -> handler and module

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants