You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/playwright-accessibility-test.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,21 +118,19 @@ set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
118
118
To enable the accessibility testing within your automated test suite, set the `accessibility: true` in your configuration file. You can also define other settings capabilities as described below.
119
119
120
120
```javascript
121
-
constcapabilities= {
122
-
'LT:Options': {
123
-
..//
124
-
"accessibility":true,
125
-
"accessibility.wcagVersion":"wcag21a",
126
-
"accessibility.bestPractice":true,
127
-
"accessibility.needsReview":true
128
-
}
129
-
}
121
+
constcapabilities= {
122
+
"accessibility":true,
123
+
"accessibility.wcagVersion":"wcag21a",
124
+
"accessibility.bestPractice":false,
125
+
"accessibility.needsReview":true
126
+
};
130
127
```
131
128
132
129
### Step 4: Add the following add-on Script
133
-
In your `lambdatest-setup.js` file add these three lines after your page creation command as shown below:
130
+
LambdaTest uses an internal Chrome extension that powers accessibility scans and generates accessibility reports. In your `lambdatest-setup.js` file add these three lines after your page creation command as shown below:
134
131
135
132
```javascript
133
+
// Load the extension for report generation of the accessibility tests
Now execute your tests and visit the [Automation Dashboard](https://accounts.lambdatest.com/dashboard). Click on the Accessibility tab and check the report generated.
144
142
145
143
```bash
146
-
node test
144
+
npx playwright test --config=./playwright.config.js
You can access the detailed accessibility report from the [Accessibility Automation Reports Dashboard](https://accessibility.lambdatest.com/automation)
Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest Selenium Grid. You can obtain these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build) or through [LambdaTest Profile](https://accounts.lambdatest.com/login).
89
91
90
92
**Step 3:** Set LambdaTest `Username` and `Access Key` in environment variables.
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
108
+
</CodeBlock>
109
+
</div>
110
+
</TabItem>
111
+
</Tabs>
99
112
100
113
## Run Your First Test
101
114
***
102
115
### Sample Test with NightwatchJS
103
116
Let’s check out a sample **Nightwatch** framework code running on LambdaTest Selenium Grid. This is a simple Nightwatch automation script that tests a sample to-do list app. The code marks two list items as done, adds a list item and then finally gives the total number of pending items as output.
104
-
```js
105
-
//googleTest.js
106
-
107
-
var https =require("https");
108
-
var lambdaRestClient =require("@lambdatest/node-rest-client");
109
-
var lambdaCredentials = {
110
-
username:process.env.LT_USERNAME,
111
-
accessKey:process.env.LT_ACCESS_KEY
112
-
};
113
-
var lambdaAutomationClient =lambdaRestClient.AutomationClient(
**Step 4:** Below is the `nightwatch.conf.js` file where we will be declaring the desired capabilities. Since we are using remote webdriver, we have to define which browser environment we want to run the test. We do that by passing browser environment details to LambdaTest Selenium Grid via desired capabilities class.
> You can generate capabilities for your test requirements with the help of our inbuilt **[Capabilities Generator tool](https://www.lambdatest.com/capabilities-generator/)**.
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on [LambdaTest automation dashboard](https://automation.lambdatest.com/build). LambdaTest Automation Dashboard will help you view all your text logs, screenshots and video recording for your entire automation tests.
135
+
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on [LambdaTest automation dashboard](https://automation.lambdatest.com/build).
0 commit comments