-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix rbac test #22912
Fix rbac test #22912
Conversation
💚 Build Succeeded |
💚 Build Succeeded |
Pulled the PR and tested it on local in a loop. It has been passing consistently. However on cloud I see that it failed. I have attached the output here. |
@@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) { | |||
|
|||
describe('Management', () => { | |||
before(async () => { | |||
await PageObjects.security.login('elastic', 'changeme'); | |||
// await PageObjects.security.login('elastic', 'changeme'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented line can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - tested rbac tests locally
It passed successfully on cloud - ran it twice. LGTM . |
* conditionalize Monitoring tests for Cloud testing * make security_page/login wait * revert these files from another PR * revert these files from another PR
* conditionalize Monitoring tests for Cloud testing * make security_page/login wait * revert these files from another PR * revert these files from another PR
The common_page navigateToUrl and navigateToApp both check if they hit a login page when navigating. This is in the OSS Kibana test page objects (and not x-pack) so that we can run the kibana functional UI tests against Cloud or any other Kibana which has security enabled. It doesn't allow for logging in as different users. Only the configured super user (which can be passed in env vars for the Cloud case).
We also have login/logout methods in x-pack/test/functional/page_objects/security_page.js. And these do allow passing specific user/pwd. But the login method in security_page instantly returned after clicking Submit. So any actions (like navigation) that happen right after that login could have problems because the page was still loading.
I added the same check after clicking Submit that we had in the common_page method.
But then I found that the test for invalid user/pwd failed because it was waiting for kibanaChrome element which never appears in that case. So I added a
expectSuccess = true
parameter to the login method and only wait for kibanaChrome if that's true. The invalid login test now passesfalse
.I thought about eliminating any redundancy between that common_page and security_page, but didn't want the OSS kibana tests to reference x-pack code when everything else references from x-pack to OSS.
At some point we might just combine all the test stuff into the base OSS folders...