x-govuk / govuk-rspec-helpers Goto Github PK
View Code? Open in Web Editor NEWRSpec test helpers for GOV.UK services
Home Page: https://x-govuk.github.io/govuk-rspec-helpers/
License: MIT License
RSpec test helpers for GOV.UK services
Home Page: https://x-govuk.github.io/govuk-rspec-helpers/
License: MIT License
This could check:
Anything else?
We should set up a GitHub workflow which auto publishes to rubygems (when tagged?).
See publish.yml from the govuk-components repo for an example.
@peteryates would you mind helping with this?
The Design System guidance for buttons says:
If you are working in production and research shows that users are frequently sending information twice, you can configure the button to ignore the second click.
To do this, set the data-prevent-double-click attribute to true.
However it also says:
In the case of slow connections, aim to give the user information about what’s happening, for example, by showing a loading spinner or a modal, before using data-prevent-double-click.
So we shouldn't expect it to be set on every button. Instead, it could be opt-in?
click_govuk_button("Send", prevent_double_click: true)
The Design System guidance for Buttons says:
Use a default button for the main call to action on a page.
Avoid using multiple default buttons on a single page. Having more than one main call to action reduces their impact, and makes it harder for users to know what to do next.
We could consider checking for this. However the guidance is only "avoid" rather than a hard rule, so it might need to be overridden.
These attributes should be present to avoid the risk of reverse tabnapping. See guidance.
Following the addition of fill_in_govuk_text_field
in #12 we should add a similar fill_in_govuk_password_field
helper.
As well as checking that type=password
, this could additionally check that:
autocomplete="new-password"
or autocomplete="current-password"
spellcheck="false"
Error message ‘Personal details not marked as complete’ links to #personal_details but no input field has this ID or name
The thing is that, in this instance, #personal_details
is a link to another page where the error can be fixed:
<a name="personal_details" class="govuk-link" href="/trainees/ZWV3EDmJtXJqYSfkFv1GY8bi/personal-details/edit">Continue section<span class="govuk-visually-hidden"> personal details</span></a>
Following the addition of fill_in_govuk_text_field
in #12 we should add a similar fill_in_govuk_email_field
helper.
As well as checking that type="email"
, this could additionally check that:
autocomplete="email"
(could be opt-in or opt-out as you wouldn't want this if asking for someone else’s email)spellcheck="false"
This is what I see, and what I don't want to see:
Title tag is missing the error prefix: ‘
Error: Check trainee record - Register trainee teachers - GOV.UK
’
The click_govuk_button
helper should also work with <input type="submit">
, mirroring the behaviour of click_button
.
Following the addition of fill_in_govuk_text_field
in #12 we should add a similar fill_in_govuk_telephone_number_field
helper (or maybe fill_in_govuk_tel_field
?).
As well as checking that type="tel"
, this could additionally check that:
autocomplete="tel"
(could be opt-in or opt-out as you wouldn't want this if asking for someone else’s phone number)@paulrobertlloyd has volunteered. 😁
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.