-
Notifications
You must be signed in to change notification settings - Fork 188
feat: Native form submit for wizard component #3734
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
base: main
Are you sure you want to change the base?
Conversation
src/wizard/__integ__/wizard.test.ts
Outdated
async type(text: string) { | ||
// `await this.keys(text);` doesn't work as it key presses too quickly and doesn't | ||
// allow the separator to be appended so the cursor position gets messed up. | ||
for (let k = 0; k < text.length; k++) { | ||
await this.keys(text[k]); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be achieved by using the following inside the test itself instead of a helper function on the WizardPageObject
class: await page.keys(['input text'])
like here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, how does it differentiate between a user wanting to type in the literal string "Enter" and wanting to hit return ("Enter")?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is leaning WebDriverIO's keys
functions which will treat a string either as a chain of text to type or a keycode such as 'Enter' or 'ArrowLeft': https://webdriver.io/docs/api/browser/keys/
@@ -19,7 +19,7 @@ afterEach(() => { | |||
clearVisualRefreshState(); | |||
}); | |||
|
|||
const skippedComponents = ['button']; | |||
const skippedComponents = ['button', 'wizard']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, before doing this... I tried setting the hidden submit
button to disabled
and setting onClick
to preventDefault()
but this test was still triggering it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3734 +/- ##
=======================================
Coverage 97.06% 97.06%
=======================================
Files 835 835
Lines 24161 24189 +28
Branches 8463 8472 +9
=======================================
+ Hits 23451 23479 +28
Misses 705 705
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Related links, issue #, if available: n/a
jGwYAejXwIQb
AWSUI-60156
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.