-
Notifications
You must be signed in to change notification settings - Fork 83
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
Bug in page object example and example doesn't match intern-tutorial #45
Comments
Could you add links to the specific page object example of interest, and also to the intern-tutorial page you're looking at? (The intern-tutorial hasn't been updated in quite some time.) |
Hi @jason0x43 , absolutely. Thanks for the reply. Here is the example I was looking at. Its also worth mentioning I'm having a lot of trouble getting the example to work.. I thought It was me not applying it correctly, though now I'm not sure. I'll explain here, but I'm admittedly not and expert with the finer points of JS. In this portion this portion:
I still need to use the
Then THIS works, but then I add the Something like...
Doing this though, I'm not sure how I could continue chaining on with other page objects after I used the Also, If you do update the example, following the newer syntax looked like this for me if it saves you any time
|
Sorry, I misread your comment earlier. The example can't be linked in from the project. The file is created through out the tutorial process. The example in question starts on line 220 of the readme though in the intern example you linked. |
So, the example in the guide (at https://theintern.github.io/intern/#page-objects) uses an architecture that many have found a bit tricky to work with, but it is technically workable. I'm still not sure what other example you're looking at, though. The intern-tutorial (https://github.com/theintern/intern-tutorial) doesn't mention page objects so far as I'm aware. A somewhat easier way to implement page objects (at least to me) is to use helper functions (https://stackoverflow.com/questions/42837483/intern-js-how-to-return-pageobject-of-the-page-from-the-function-which-opens-it/42838529#42838529). |
Hi @jason0x43 , yep, you are correct (and thank you for being so helpful!). I've figured this out using the example from SO you linked above.. trying to match your dedication here though, so this is what my original issue was more so following :) The intern-tutorial does not use page objects in its example as you mentioned. The issue I ran into (and this is nitpicky) was when I was trying to add a page object to the intern-tutorial using the example here "Then, the page object would be used in tests instead of the this.remote object:": which has syntax like:
and translating that to fit into the example on the intern-turtorial which looks like this:
which I think would end up looking like this:
basically, the example in the docs uses older syntax, and the intern-tutorial uses newer syntax, and mapping between them was confusing (at least for me at first.. had to brush off some JS dust that piled up). I ended up implementing page objects as linked by that SO link as well :), very helpful. I personally understand this now (implementing page objects with the alternative) if that is enough for the issue to close. Thanks again! |
I saw a helpful page object example that was added in the docs here with issue #16 .
The current example of how the page object is out of date with the new JS syntax used in the latest version of the intern-tutorial page.
The text was updated successfully, but these errors were encountered: