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

[WIP] New steps - verify selected, verify not selected #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chris-bingham
Copy link

  • Steps to verify that an item is selected or that it is not selected
  • These work for checkboxes, radiobuttons, options in a select element
  • Decided to write these as I found it can be necessary to check whether a checkbox is checked without then checking it when it isn't

* Verify {{element}} is not selected {
// Will always pass if element is not selectable
const el = (await $(element));
expect(await el.isSelected()).to.equal(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not manage the time out if it does not find it as for this code:

* Verify {{element}} is not visible {
        await not$(element, undefined, VERIFY_TIMEOUT, true);
}

@vptes1
Copy link
Collaborator

vptes1 commented Oct 23, 2019

This is already handled by the selected and not selected ElementFinder props. For example, Verify 'list item, selected' is visible (verify that a visible element that matches props 'list item' and 'selected' exists). Check out elementfinder.js.

This was a conscious design decision: anything that describes the state of html is to be described by a prop, and multiple props can be combined to form new props.

Now, if you feel there is a special need to have a more natural-sounding step just for the selected state, I'm totally open to discuss that :) Though, this too can be achieved through props, for example, with props({'selected list item': '.list-item, selected'}) and then using Verify 'selected list item' is visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants