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

[BUG] SAML integration test has trouble for locating sign-in button #1506

Closed
RyanL1997 opened this issue Jul 10, 2023 · 3 comments
Closed

[BUG] SAML integration test has trouble for locating sign-in button #1506

RyanL1997 opened this issue Jul 10, 2023 · 3 comments
Labels
bug Something isn't working untriaged

Comments

@RyanL1997
Copy link
Collaborator

What is the bug?
SAML integration test has trouble for locating sign-in button

What is your host/environment?
main branch

Do you have any screenshots?
Error log:

FAIL test/jest_integration/saml_auth.test.ts (24.405 s)
  start OpenSearch Dashboards server
    ✕ Login to app/opensearch_dashboards_overview#/ when SAML is enabled (2637 ms)
    ✕ Login to app/dev_tools#/console when SAML is enabled (2445 ms)
    ✕ Login to Dashboard with Hash (2236 ms)
    ○ skipped Tenancy persisted after Logout in SAML

  ● start OpenSearch Dashboards server › Login to app/opensearch_dashboards_overview#/ when SAML is enabled

    NoSuchElementError: Unable to locate element: *[id="btn-sign-in"]

      241 |     const driver = getDriver(browser, options).build();
      242 |     await driver.get('http://localhost:5601/app/opensearch_dashboards_overview#/');
    > 243 |     await driver.findElement(By.id('btn-sign-in')).click();
          |     ^
      244 |     await driver.wait(until.elementsLocated(By.xpath(pageTitleXPath)), 10000);
      245 |
      246 |     const cookie = await driver.manage().getCookies();

      at Object.throwDecodedError (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/error.js:524:15)
      at parseHttpResponse (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:601:13)
      at Executor.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:529:28)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at toWireValue (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:145:15)
      at plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:195:16
      at forEachKey (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:189:9)
      at convertKeys (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:194:3)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:743:22)
      at Object.<anonymous> (plugins/security-dashboards-plugin/test/jest_integration/saml_auth.test.ts:243:5)

  ● start OpenSearch Dashboards server › Login to app/dev_tools#/console when SAML is enabled

    NoSuchElementError: Unable to locate element: *[id="btn-sign-in"]

      253 |     const driver = getDriver(browser, options).build();
      254 |     await driver.get('http://localhost:5601/app/dev_tools#/console');
    > 255 |     await driver.findElement(By.id('btn-sign-in')).click();
          |     ^
      256 |
      257 |     await driver.wait(
      258 |       until.elementsLocated(By.xpath('//*[@data-test-subj="sendRequestButton"]')),

      at Object.throwDecodedError (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/error.js:524:15)
      at parseHttpResponse (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:601:13)
      at Executor.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:529:28)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at toWireValue (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:145:15)
      at plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:195:16
      at forEachKey (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:[189](https://github.com/opensearch-project/security-dashboards-plugin/actions/runs/5510435982/jobs/10044639422#step:14:190):9)
      at convertKeys (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:194:3)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:743:22)
      at Object.<anonymous> (plugins/security-dashboards-plugin/test/jest_integration/saml_auth.test.ts:255:5)

  ● start OpenSearch Dashboards server › Login to Dashboard with Hash

    NoSuchElementError: Unable to locate element: //*[@id="btn-sign-in"]

      271 |     await driver.manage().deleteAllCookies();
      272 |     await driver.get(urlWithHash);
    > 273 |     await driver.findElement(By.xpath(signInBtnXPath)).click();
          |     ^
      274 |     // TODO Use a better XPath.
      275 |     await driver.wait(
      276 |       until.elementsLocated(By.xpath('/html/body/div[1]/div/header/div/div[2]')),

      at Object.throwDecodedError (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/error.js:524:15)
      at parseHttpResponse (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:601:13)
      at Executor.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/http.js:529:28)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at toWireValue (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:145:15)
      at plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:195:16
      at forEachKey (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:189:9)
      at convertKeys (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:[194](https://github.com/opensearch-project/security-dashboards-plugin/actions/runs/5510435982/jobs/10044639422#step:14:195):3)
      at thenableWebDriverProxy.execute (plugins/security-dashboards-plugin/node_modules/selenium-webdriver/lib/webdriver.js:743:22)
      at Object.<anonymous> (plugins/security-dashboards-plugin/test/jest_integration/saml_auth.test.ts:273:5)

Do you have any additional context?
PRs impact by this issue:

  1. filter high level groups and action groups by cluster and index Update nextUrl validation to incorporate serverBasePath (#2048) (#2050) #2102: https://github.com/opensearch-project/security-dashboards-plugin/actions/runs/5510435982/jobs/10044639422#step:14:164
@cwperks
Copy link
Member

cwperks commented Jul 11, 2023

More information can be found on this issue here: opensearch-project/security#2927 (comment)

@cwperks
Copy link
Member

cwperks commented Jul 11, 2023

FYI The fix for this is being prepared here: opensearch-project/security#2987

The upgrade of the SAML libs required additional permissions and the error was not caught in integ tests for the security plugin, but instead caught in this repo

@RyanL1997
Copy link
Collaborator Author

I think we can close this for now since the main branch of security frontend has been unblocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

2 participants