This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Description
Bug report
- Node Version:
6.10.2
- Protractor Version:
5.2.0
- Angular Version: ``
- Browser(s):
Chrome, Firefox
- Operating System and Version
System Version: macOS 10.12.6 (16G29)
- Your protractor configuration file
Assume use of the Tutorial examples
- A relevant example test
"Using Page Objects to Organize Tests" tutorial
- Output from running the test
...
[chrome #11] Failures:
[chrome #11] 1) MyPage should have a title
[chrome #11] Message:
[chrome #11] Failed: MyPage is not defined
[chrome #11] Stack:
[chrome #11] ReferenceError: MyPage is not defined
...
- Steps to reproduce the bug
Run the tutorial as presented on "Using Page Objects to Organize Tests"
- The URL you are running your tests against (if relevant)
See Tutorial
There are some rather gross assumptions on the Page Objects introduction. The link at the top takes a user to Selenium's documented examples using Java. Oddly, enough, this link teases the root of the problem.
In running the examples as presented, there is no introduction to how the page objects are loaded, whereas in the Java examples there is the built-in Java classloader, through the import statement, that is expected as a Java developer.
The JavaScript class loader works differently and the documentation does not set up the config file, note any require needs from node, or where the spec or page object should live relative to each other to run the presented examples.