Functional tests for the Getting Started page#11850
Functional tests for the Getting Started page#11850ycombinator merged 13 commits intoelastic:masterfrom
Conversation
There was a problem hiding this comment.
Super minor, but this seems the only method that doesn't have a log.debug
There was a problem hiding this comment.
Why is this even an instantiated class? I'm not seeing any local state or anything. All the methods just call static methods, or instance methods off already instantiated objects.
There was a problem hiding this comment.
I'm not sure TBH. I was following the pattern already established with other page objects. If we want to change this pattern I suggest we open a new issue for doing it across the board for all page objects and then fix it there.
There was a problem hiding this comment.
Maybe not a better way, but does this defaultIndex need to match anything else that is setup in the test runner? I'd just want to avoid a scenario where this value is configured somewhere, it's copied here, but then someone possibly changes the value later in the future and this test breaks and it's not clear why. It's entirely possible that I'm missing something but just wanted to point it out in case it could happen
There was a problem hiding this comment.
Yeah, I see what you mean. There's an implicit dependency here between this line and the await esArchiver.load('discover'); line a couple of lines further down. It would probably be better to create a wrapper method somewhere like loadDefaultIndex that loads the actual data using esArchiver.load but also sets up the defaultIndex value, and then use that wrapper method here.
All that said, this here is a pattern that is already established and being used in several places. So I suggest we open an issue for fixing this across the board rather than increasing the scope of this PR.
There was a problem hiding this comment.
Should we have a test that ensures the navigation is displayed properly when the user manually navigates to the Getting Starting page from the Management page?
There was a problem hiding this comment.
I added this as part of 5351e614e10d9ba6355ea309e1f17be2ce234eda.
There was a problem hiding this comment.
You might want to add a before hook here that ensures that the getting started local storage entry is not set, with remote.deleteLocalStorageItem() https://theintern.github.io/leadfoot/module-leadfoot_Command.html#deleteLocalStorageItem
There was a problem hiding this comment.
When I try this I get this error:
│ [DELETE http://localhost:9515/session/dfa8779e7e55a011f085086a3a75031b/local_storage/key/kibana.isGettingStartedOptedOut] <unknown>: Failed to read the 'localStorage' property from'Window': Access is denied for this document.
│ (Session info: chrome=58.0.3029.110)
│ (Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.12.4 x86_64)
There was a problem hiding this comment.
I think its because the Kibana web site hasn't been loaded up at that point.
There was a problem hiding this comment.
I think I have a fix.
There was a problem hiding this comment.
Fixed as part of 6334019d6abc5013861772809440b418268c156a.
5351e61 to
111c9d7
Compare
|
@chrisronline @spalger I've addressed review comments and rebased after #11881 was merged recently. This is ready for your 👀 again. Thanks! |
chrisronline
left a comment
There was a problem hiding this comment.
LGTM. Just some minor notes
There was a problem hiding this comment.
What's the reason behind these changes? Do you need the checking to live in a promise chain?
There was a problem hiding this comment.
Hmm, these changes don't look right. They are probably a result of this PR co-existing with #11881 at one point and all the rebasing that was happening at the time. I'm going to update this PR with only commits related to it. Stay tuned!
7cf3ee7 to
36ce0eb
Compare
|
Jenkins, test this |
|
Thanks, I've removed that line in 5089559. Will merge once CI goes green. |
This set of tests specifically tests the scenarios under which a user should or should not get redirected to the Getting Started page
83460ae to
5089559
Compare
* Adding some more functionality to the Getting Started page object * Using optOut method from Getting Started page object * Adding functional tests for Getting Started page This set of tests specifically tests the scenarios under which a user should or should not get redirected to the Getting Started page * Adding log.debug message * Conforming to HTML style guide * Using new GettingStarted page object methods + opting out * Adding test for nav being shown * Removing unnecessary line * Navigate to Discover expecting to be redirected to the Getting Started page * Trying beforeEach instead of before * Remove LS data index + load empty kibana index * Removing unnecessary line * Fixing order of operations
|
Backported to:
|
* Adding some more functionality to the Getting Started page object * Using optOut method from Getting Started page object * Adding functional tests for Getting Started page This set of tests specifically tests the scenarios under which a user should or should not get redirected to the Getting Started page * Adding log.debug message * Conforming to HTML style guide * Using new GettingStarted page object methods + opting out * Adding test for nav being shown * Removing unnecessary line * Navigate to Discover expecting to be redirected to the Getting Started page * Trying beforeEach instead of before * Remove LS data index + load empty kibana index * Removing unnecessary line * Fixing order of operations
This reverts commit 099178a.
* Revert "When on an embedded page, bypass Getting Started gate check (#12040)" This reverts commit 05293f1. * Revert "Making tweaks. (#12003)" This reverts commit aa3fa06. * Revert "Functional tests for the Getting Started page (#11850)" This reverts commit 099178a. * Revert "Prevent flicker on Getting Started page (#11826)" This reverts commit c4b3ade. * Revert "Getting Started page (#11805)" This reverts commit 32eff37. * Remove check for Getting Started page from navigateToApp
* Revert "When on an embedded page, bypass Getting Started gate check (#12040)" This reverts commit 05293f1. * Revert "Making tweaks. (#12003)" This reverts commit aa3fa06. * Revert "Functional tests for the Getting Started page (#11850)" This reverts commit 099178a. * Revert "Prevent flicker on Getting Started page (#11826)" This reverts commit c4b3ade. * Revert "Getting Started page (#11805)" This reverts commit 32eff37. * Remove check for Getting Started page from navigateToApp
* Revert "When on an embedded page, bypass Getting Started gate check (elastic#12040)" This reverts commit 05293f1. * Revert "Making tweaks. (elastic#12003)" This reverts commit aa3fa06. * Revert "Functional tests for the Getting Started page (elastic#11850)" This reverts commit 099178a. * Revert "Prevent flicker on Getting Started page (elastic#11826)" This reverts commit c4b3ade. * Revert "Getting Started page (elastic#11805)" This reverts commit 32eff37. * Remove check for Getting Started page from navigateToApp
This PR starts to add some functional tests for the Getting Started page. Specifically, it adds functional tests that exercise the scenarios under which a user should or should not get redirected to the Getting Started page.
It also does a small bit of refactoring in the Console tests that use the Getting Started page object to opt out of the Getting Started page.