Skip to content
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

Merged
merged 4 commits into from
Sep 11, 2018
Merged

Fix rbac test #22912

merged 4 commits into from
Sep 11, 2018

Conversation

LeeDr
Copy link

@LeeDr LeeDr commented Sep 10, 2018

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 passes false.

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...

@LeeDr LeeDr added test Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! flaky-failing-test test_xpack_functional labels Sep 10, 2018
@LeeDr LeeDr requested a review from legrego September 10, 2018 23:33
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@rashmivkulkarni
Copy link
Contributor

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.
output .pdf

@@ -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');
Copy link
Contributor

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.

Copy link
Member

@legrego legrego left a 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

@rashmivkulkarni
Copy link
Contributor

It passed successfully on cloud - ran it twice. LGTM .

@LeeDr LeeDr merged commit 4f26340 into elastic:master Sep 11, 2018
LeeDr pushed a commit to LeeDr/kibana that referenced this pull request Sep 11, 2018
* conditionalize Monitoring tests for Cloud testing

* make security_page/login wait

* revert these files from another PR

* revert these files from another PR
LeeDr pushed a commit to LeeDr/kibana that referenced this pull request Sep 11, 2018
* conditionalize Monitoring tests for Cloud testing

* make security_page/login wait

* revert these files from another PR

* revert these files from another PR
@LeeDr
Copy link
Author

LeeDr commented Sep 11, 2018

Fixes: #22719
Fixes: #22722

LeeDr pushed a commit that referenced this pull request Sep 11, 2018
* conditionalize Monitoring tests for Cloud testing

* make security_page/login wait

* revert these files from another PR

* revert these files from another PR
LeeDr pushed a commit that referenced this pull request Sep 11, 2018
* conditionalize Monitoring tests for Cloud testing

* make security_page/login wait

* revert these files from another PR

* revert these files from another PR
@liza-mae liza-mae added failed-test A test failure on a tracked branch, potentially flaky-test and removed flaky-failing-test labels Nov 1, 2018
@LeeDr LeeDr deleted the fixRbacTest branch August 20, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! test_xpack_functional test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants