Part of the Robot Ninja test suite is testing that an existing customer is able to log into their account via your store's My Account page.

After submitting the login form, Robot Ninja will try confirm the user was successfully logged in by looking for a logout link on the page using the following selector: .woocommerce-MyAccount-navigation-link--customer-logout .

If Robot Ninja can't find this selector your test will fail with error message.

After completing the login form, Robot Ninja was unable to confirm the user was successfully logged in by looking for an element with `.woocommerce-MyAccount-navigation-link--customer-logout`.

How to use custom selectors to confirm the user has successfully logged in?

If you already have a custom CSS selector you'd like to use to confirm the user has successfully logged in then please skip to step 4.

1. Open Chrome, Firefox or Safari (or any other browser with developer tools) and go to your store's My Account page while logged in.

2. Right click on any unique element on the page which indicates the user has successfully logged in

3. Find a Class, ID, XPath or CSS selector for the chosen element
(CSS = .logged-in .woocommerce-MyAccount-content).

4. Set the custom selector for "Close the cookie notice on store"  in Robot Ninja by going to Store > Settings > Selectors from the Dashboard.

5. Click the update button and queue up your tests again 🥳

Other helpful links

FAQ

How to tell if the failed test can be fixed using a custom selector?

The screenshot attached to the test will show you where the test ended up at time of failure. The first thing to do would be to check the screenshot to see if the customer has successfully logged in.

If the screenshot shows the customer has logged in, then this indicates that Robot Ninja is looking for the wrong element and custom selectors will fix the issue.

Did this answer your question?