-
Notifications
You must be signed in to change notification settings - Fork 8
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
Evaluate testing APIs that components should expose to client applications #265
Comments
Related: #362 |
As part of this work it could be helpful to make the helpers in async-test-utilities available to clients via our public API. In this PR a client ended up duplicating one of those APIs. |
As part of this work, we need to find a way to capture the async timing behavior: #362 (comment) |
Another example use case appeared on this AzDO PR. The page object for the properties list component is explicitly firing an Same for nimble-number-field (this was explicitly requested by the Argon team in a chat with me on 4/6/22). For the number field we should ensure it works well with both 'value' (string) and 'valueAsNumber' (numeric). |
@gokulakrishnan-ni wanted to be able to simulate button click interactions in test. The approach that was used was not aware of disabled state. Pointed to the FAST approach which was to run the |
We should be aware of how users are expected to use JS-based test harnesses in test frameworks like test cafe: https://ni.visualstudio.com/DevCentral/_git/srd-semi-ses-software/pullrequest/278853?discussionId=2905287&_a=files&path=%2fArgon%2fServices%2fEnd2EndTests%2ftests%2fpage-objects%2flogin-page.js |
Some more good examples in the pageobject this PR. Specifically all the methods that operate on the |
In this PR, I had to write a pageObject method implementation to do some fairly specific event dispatching coupled with particular state changes, to achieve an analogous user interaction behavior. It might be beneficial to capture this sort of user interaction with the Combobox in a Nimble test harness. |
I'm closing #362 because that issue included a collection of tips that are too low-level to document but would be great candidates to include in a page object for nimble-tabs. If we work on this issue we should mine that discussion thread for ideas around |
Some interesting topics:
|
A bit on the fence about exposing the Another way to look at the issue is that clients are needing to be aware of those implementation details of nimble controls (I make an update and need to waitMicrotask or waitTask for X ms). Talking to @atmgrifter00 hopefully user's needing to be aware of those details could be mitigated altogether with good page objects for the controls. |
@rajsite pointed out that the FAST element 2 refactor of the task queue now exposes a mode to process async tasks synchronously in tests. We could consider telling clients to use that mode (and maybe have our page objects only work in that mode) and avoid us manually managing the queue via |
Another use case from this PR:
|
Playwright page objects might be a good way to address #1339. The way to check if an element is disabled changes depending on the type of element and that logic could be encapsulated in a page object. |
I spent an innovation day trying to write a page object for select. Got it fairly far along but didn't end up submitting it, so linking it here as a starting point if we ever prioritize this. #1500 |
We have slowly made progress on this issue by adding a few new page objects. But there are open questions on best practices that we should reach consensus on and document somewhere. Some of this was discussed in this thread.
In a discussion today the team agreed on items 1-5 and want to continue refining the items in 6. I will capture those guidelines in CONTRIBUTING and update some page objects to follow them in an upcoming PR. |
…2343) # Pull Request ## 🤨 Rationale Followup for #2183 . Once I started uptaking the built-in label change in SLE, I saw several page objects that will need a Nimble-provided way to get the label text (so the SLE page objects don't need to query inside the Nimble shadow roots). ## 👩💻 Implementation - Add `getLabelText()` to select and combobox page objects ## 🧪 Testing - Add new test files for these 2 page objects, with 2 tests each for `getLabelText()`. - These follow the new guidance in [the discussion in #265](#265 (comment)) ## ✅ Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
Copied from User Story 1537054: Evaluate testing APIs that components should expose to client applications
(See also the comments in that US)
It should be easy for a client application to write a test which includes a component in the page, configures it, interacts with it, and inspects its visual state.
We've had good success following Angular Material's test harness/page object pattern and we had many challenges with the testability of Smart elements. We should evaluate what testing APIs the nimble components need to expose to be delightful for client applications to consume them.
The primary goal for now is Angular client applications, but we should see if we can write this layer at the nimble-components level so that other frameworks could take advantage of it too.
Current status
A branch exists that includes:
A not building branch exists that shows what it looks like to use that page object in an Angular app.
Possible next steps
The text was updated successfully, but these errors were encountered: