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] 1_create_datasource.spec.js fail due to multiple submit #439

Closed
ananzh opened this issue Jan 10, 2023 · 1 comment
Closed

[BUG] 1_create_datasource.spec.js fail due to multiple submit #439

ananzh opened this issue Jan 10, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ananzh
Copy link
Member

ananzh commented Jan 10, 2023

What is the bug?

Currently, 1_create_datasource.spec.js test suite fails due to multiple submit element found in the test. Details error log is pasted below:

Running:  core-opensearch-dashboards/opensearch-dashboards/datasource-manageme          (15 of 17)
            nt-plugin/1_create_datasource.spec.js                                                   


  Create datasources
    ✓ should successfully load the page (7821ms)
    ✓ should successfully show the experimental feature callout
    Datasource can be created successfully
      1) with no auth and all required inputs
      2) with basic auth and all required inputs
      3) with no auth and all inputs
      4) with basic auth and all inputs
    Title validation
      ✓ validate that title is a required field
      5) validate that title cannot use existing datasource name
      ✓ validate that title field does not show any error if title is valid and unique
    Description validation
      ✓ validate that description field does not show any error if the field is empty
      ✓ validate that description field does not show any error if there is a description
    Endpoint validation
      ✓ validate that endpoint is a required field
      ✓ validate that endpoint field cannot use invalid format of URL
      ✓ validate that endpoint field does not show any error if URL is valid
    Username validation
      ✓ validate that username field does not show when auth type is no auth
      ✓ validate that username is a required field when auth type is username & password
      ✓ validate that username field does not show any error when auth type is username & password and field is not empty
    Password validation
      ✓ validate that password field does not show when auth type is no auth
      ✓ validate that password is a required field when auth type is username & password
      ✓ validate that password field does not show any error when auth type is username & password and field is not empty
    Create datasource button
      ✓ validate if create data source connection button is disabled when first visit this page
      ✓ validate if create data source connection button is disabled when there is any field error
      ✓ validate if create data source connection button is not disabled only if there is no any field error


  18 passing (2m)
  5 failing

  1) Create datasources
       Datasource can be created successfully
         with no auth and all required inputs:
     CypressError: `cy.click()` can only be called on a single element. Your subject contained 2 elements. Pass `{ multiple: true }` if you want to serially click each element.

https://on.cypress.io/click
      at mouseAction (http://localhost:5601/__cypress/runner/cypress_runner.js:152534:76)
      at Context.click (http://localhost:5601/__cypress/runner/cypress_runner.js:152713:14)
      at Context.<anonymous> (http://localhost:5601/__cypress/runner/cypress_runner.js:173267:19)
  From Your Spec Code:
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js:135:35)

  2) Create datasources
       Datasource can be created successfully
         with basic auth and all required inputs:
     CypressError: `cy.click()` can only be called on a single element. Your subject contained 2 elements. Pass `{ multiple: true }` if you want to serially click each element.

https://on.cypress.io/click
      at mouseAction (http://localhost:5601/__cypress/runner/cypress_runner.js:152534:76)
      at Context.click (http://localhost:5601/__cypress/runner/cypress_runner.js:152713:14)
      at Context.<anonymous> (http://localhost:5601/__cypress/runner/cypress_runner.js:173267:19)
  From Your Spec Code:
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js:146:35)

  3) Create datasources
       Datasource can be created successfully
         with no auth and all inputs:
     CypressError: `cy.click()` can only be called on a single element. Your subject contained 2 elements. Pass `{ multiple: true }` if you want to serially click each element.

https://on.cypress.io/click
      at mouseAction (http://localhost:5601/__cypress/runner/cypress_runner.js:152534:76)
      at Context.click (http://localhost:5601/__cypress/runner/cypress_runner.js:152713:14)
      at Context.<anonymous> (http://localhost:5601/__cypress/runner/cypress_runner.js:173267:19)
  From Your Spec Code:
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js:156:35)

  4) Create datasources
       Datasource can be created successfully
         with basic auth and all inputs:
     CypressError: `cy.click()` can only be called on a single element. Your subject contained 2 elements. Pass `{ multiple: true }` if you want to serially click each element.

https://on.cypress.io/click
      at mouseAction (http://localhost:5601/__cypress/runner/cypress_runner.js:152534:76)
      at Context.click (http://localhost:5601/__cypress/runner/cypress_runner.js:152713:14)
      at Context.<anonymous> (http://localhost:5601/__cypress/runner/cypress_runner.js:173267:19)
  From Your Spec Code:
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js:168:35)

  5) Create datasources
       Title validation
         validate that title cannot use existing datasource name:
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `input[name="dataSourceTitle"]:invalid`, but never found it.
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js:181:57)

How can one reproduce the bug?

Just check recent submitted PRs or run this test.

What is the expected behavior?

Fix the bug

@ananzh ananzh added bug Something isn't working untriaged labels Jan 10, 2023
@ananzh
Copy link
Member Author

ananzh commented Jan 10, 2023

This error is due to the below line of code in the test suite

cy.get('[type="submit"]').click();

There are two buttons have type="submit". So we see

cy.click()` can only be called on a single element. Your subject contained 2 elements. Pass `{ multiple: true }` if you want to serially click each element.

Screen Shot 2023-01-10 at 13 20 57

Apparently, type is not a unique identity to locate the element. data-test-subj is a more common property to identify an element.

ananzh added a commit to ananzh/opensearch-dashboards-functional-test that referenced this issue Jan 10, 2023
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
@ananzh ananzh removed the untriaged label Jan 10, 2023
@ananzh ananzh self-assigned this Jan 10, 2023
ananzh added a commit to ananzh/opensearch-dashboards-functional-test that referenced this issue Jan 11, 2023
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
jakubp-eliatra pushed a commit to sebastianmichalski/opensearch-dashboards-functional-test that referenced this issue Mar 24, 2023
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Jakub Przybylski <jakub.przybylski@eliatra.com>
kavilla pushed a commit to ananzh/opensearch-dashboards-functional-test that referenced this issue May 18, 2023
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
kavilla added a commit that referenced this issue May 24, 2023
* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue May 24, 2023
* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)
opensearch-trigger-bot bot pushed a commit that referenced this issue May 24, 2023
* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)
kavilla pushed a commit that referenced this issue May 24, 2023
…671)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
peterzhuamazon pushed a commit that referenced this issue May 26, 2023
…672)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
leanneeliatra pushed a commit to leanneeliatra/opensearch-dashboards-functional-test-fork that referenced this issue Sep 15, 2023
…rch-project#423) (opensearch-project#671)

* [Table visualization] Add functional tests for new table vis

There are four test cases:
* basic.spec.js contains tests related to vis page, like
inspector, save an object.
* data.spec.js tests diff metrics and buckets aggregations.
* options.spec.js contains tests on options panel.
* split.spec.js tests table functions, like sort, adjust col
width, split tables and etc.

Most tests are the same as the removed funtional tests.
split.spec.js is the only one with all new tests.

Partially Resolved:
opensearch-project#401

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix PR comments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* fix test error and add embed test suite

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* Fix multiple submit bug
Currently there are two submit type button in data source
which cause cypress fail to find and click. In this PR, I
switch to use data-test-subj to uniquely identify the btn.

Issue Resolved:
opensearch-project#439

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* missed conflict resolution

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 3dffb5f)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant