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

[CCI][Table] Add data test subjects to table components for easier testing #4172

Open
kavilla opened this issue May 30, 2023 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers OSCI Open Source Contributor Initiative test:functional

Comments

@kavilla
Copy link
Member

kavilla commented May 30, 2023

Some of the components for the table visualizations can add data test subjects to find them easier. For example: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/vis_type_table/public/components/table_vis_component_group.tsx#L25

Can be transform

        {tableGroups.map(({ table, title }, index) => (
          <div key={title} className="visTable__group" data-test-subj={`visTableGroup${index}`}>
            <TableVisComponent
              title={title}
              table={table}
              visConfig={visConfig}
              event={event}
              uiState={uiState}
            />
          </div>
        ))}

This will allow us to turn: https://github.com/opensearch-project/opensearch-dashboards-functional-test/blob/main/cypress/utils/dashboards/vis_type_table/table.js#L11

Into

cy.get(`[data-test-subj="visTableGroup${i}"]`)

This will help make the tests a little bit more stable and easier to read.

@kavilla kavilla added the enhancement New feature or request label May 30, 2023
@kavilla kavilla added good first issue Good for newcomers test:functional OSCI Open Source Contributor Initiative and removed untriaged labels May 30, 2023
@kavilla kavilla changed the title [Table] Add data test subjects to table components for easier testing [CCI][Table] Add data test subjects to table components for easier testing May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers OSCI Open Source Contributor Initiative test:functional
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant