a11y: the Antidote to k6 browser False Positives
Web UI Test Engineer, KBR
NASA Ames Research Center
Synthetic tests aren’t very resilient, and they can easily fail when small UI changes are introduced, generating unnecessary alert noise. This means that whenever a minor application element such as a button is changed, the corresponding test must be, too."
dynatrace.com/news/blog/what-is-synthetic-monitoring/
<div class="c-create-button--w l-shell__create-button">
<button class="c-create-button c-button--menu c-button--major icon-plus">
<span id="create-button-label" class="c-button__label">Create</span>
</button>
</div>
page.locator('//*[@id="openmct-app"]/div/div[2]/div[1]/button').click();
In a nutshell, locators represent a way to find element(s) on the page at any moment.
header/
├── Create Button/
│ └── createList.js
├── Search Bar/
│ └── searchOptions.js
└── Indicators/
└── Clock.js
import CreateButtonLocator from CreateButton/createList.js;
page.locator(CreateButtonLocator).click();
//CreateButton/createList.js
//
const CreateButtonLocator = "//*[@id="openmct-app"]/div/div[2]/div[1]/button"
<div class="c-create-button--w l-shell__create-button">
<button class="c-create-button c-button--menu c-button--major icon-plus"
aria-disabled="false" aria-labelledby="create-button-label">
<span id="create-button-label" class="c-button__label">Create</span>
</button>
</div>
page.locator('c-create-button.c-button__label').click()
<div class="c-create-button--w l-shell__create-button">
<button class="c-create-button c-button--menu c-button--major icon-plus">
<span id="create-button-label" class="c-button__label">Create</span>
</button>
</div>
page.locator('#create-button-label').click()
<div class="c-create-button--w l-shell__create-button">
<button class="c-create-button c-button--menu c-button--major icon-plus">
<span id="create-button-label" data-id="create-button" class="c-button__label">Create</span>
</button>
</div>
page.locator('[data-id=create-button]').click()
Web accessibility ensures web applications are designed to be usable by everyone, including those with disabilities, by following guidelines that enhance perceivability, operability, understandability, and compatibility with assistive technologies.
<div class="c-create-button--w l-shell__create-button">
<button class="c-create-button c-button--menu c-button--major icon-plus"
aria-label="Create">
<span id="create-button-label" data-id="create-button" class="c-button__label">Create</span>
</button>
</div>
page.locator('[data-id=create-button]').click()
page.locator('[aria-label="Create"]').click()
Users
Backend
API
OS
Web App
Frontend
Open MCT
YAMCS
CouchDB
k8s
Docker
Users
Backend
API
OS
Web App
Frontend
Users
Backend
API
OS
Web App
Frontend
performance.mark('search-entered');
### Some number of clicks or steps ###
performance.mark('search-returned');
performance.measure('total-search-time','search-entered,'search-returned');
###returned object
PerformanceMeasure {
name: 'total-search-time',
entryType: 'measure',
startTime: 4727964.299999952,
duration: 12436.700000047684
}
github.com/scottbell/openmct-quickstart
from browserstack.com/speedlab
### Automated e2e test run on every PR
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
### Automated k6 test run downstream
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
openmct
openmct-performance
k6-browser
First Load | Loaded Page | Session |
---|
const client = await page.target().createCDPSession();
await client.send('Network.enable');
await client.send('Network.emulateNetworkConditions', {
# 5% Decrease in Ad revenue
latency: 500
});
await page.route('**/*.png', route => {
route.fulfill({
body: './bing.png'
});
});
And lastly, many synthetic monitoring tools lack the context needed to explain why a specific failure happened or what the business implications might be, lengthening time to resolution and making it unnecessarily difficult to prioritize application performance issues."
dynatrace.com/news/blog/what-is-synthetic-monitoring/
***** Asterisk
What it solves:
*Generate many, many
measurements!
** Tap into the huge k6 ecosystem to integrate and correlate with System Monitoring, Load Testing, etc
(Chrome! Devtools!)
Load Testing Can't Properly Approximate Frontend Performance Regressions
Google found that when they increased the search results from 10 to 30, the load time increased by half a second and resulted in a 20% decrease in ad revenues."