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

fix!: remove actions functionality #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ These can all be set at a suite level, as well as a URL level, like so:
}
...
```
### Actions

n-test allows some basic actions (e.g. clicking, interacting with forms). This has been ported from [pa11y](https://github.com/pa11y/pa11y) - see the [section on their README](https://github.com/pa11y/pa11y/blob/5.0.4/README.md#actions) for more.

### FT User Sessions

Expand Down
277 changes: 0 additions & 277 deletions lib/helpers/actions.js

This file was deleted.

9 changes: 0 additions & 9 deletions lib/smoke/puppeteer-page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const getUserTokens = require('./get-user-tokens');
const setSessionCookies = require('./set-session-cookies');
const runAction = require('../helpers/actions');
const { URL } = require('url');

const REDIRECT_CODES = [301, 302, 303, 307, 308];
Expand All @@ -27,7 +26,6 @@ class PuppeteerPage {
this.dimensions = DIMENSIONS[options.breakpoint] || DIMENSIONS['XL'];
this.user = options.user || null;
this.requestHeaderPaths = options.requestHeaderPaths || [];
this.actions = options.actions || [];

this.pageErrors = [];
this.consoleMessages = [];
Expand Down Expand Up @@ -169,13 +167,6 @@ class PuppeteerPage {
const gotoResponse = await this.page.goto(this.url.toString(), { waitUntil: this.waitUntil });
this.response = this.response || gotoResponse;

// Run actions
if (this.actions.length) {
for (const action of this.actions) {
await runAction(browser, this.page, action);
}
}

if(this.check.cssCoverage) {
this.coverageReports = await this.page.coverage.stopCSSCoverage();
}
Expand Down
8 changes: 0 additions & 8 deletions test/fixtures/smoke-pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ module.exports = [{
maxPixels: 0
}
}
},
'/actions': {
actions: [
'click element .my-button'
],
elements: {
'.content': true
}
}
}
}];
19 changes: 0 additions & 19 deletions test/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,6 @@ app.get('/no-jank', (req, res) => {
`);
});

app.get('/actions', (req, res) => {
res.send(`
<body>
<style>
.content {
display: none;
}
</style>
<div class="content">Content</div>
<button class="my-button">Show content</button>
<script async defer>
document.querySelector('.my-button').addEventListener('click', () => {
document.querySelector('.content').style.display = 'block';
});
</script>
</body>
`);
});

if (!module.parent) {
app.listen(process.env.PORT || 3004);
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/tasks/smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Smoke Tests of the Smoke', () => {
});
smoke.run()
.then((results) => {
expect(results.passed.length).toEqual(12);
expect(results.passed.length).toEqual(11);
expect(results.failed.length).toEqual(0);
expect(results.errors.length).toEqual(0);
done();
Expand Down