Skip to content

Commit

Permalink
update cypress testing
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Tackett <[email protected]>
  • Loading branch information
Adam Tackett committed Jan 28, 2025
1 parent c21ae08 commit ebc2a36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,22 @@ describe('Testing traces tree view', () => {
cy.get("[data-test-subj='treeExpandAll']").click();
cy.get("[data-test-subj='treeCollapseAll']").click();

cy.get("[data-test-subj='spanId-link']")
cy.get("[data-test-subj='spanId-flyout-button']")
.should('have.length', 6)
.then((initialSpanIds) => {
const initialCount = initialSpanIds.length;
expect(initialCount).to.equal(6);

cy.get("[data-test-subj='treeExpandAll']").click();

cy.get("[data-test-subj='spanId-link']").then((expandedSpanIds) => {
cy.get("[data-test-subj='spanId-flyout-button']").then((expandedSpanIds) => {
const expandedCount = expandedSpanIds.length;
expect(expandedCount).to.equal(10);
});

cy.get("[data-test-subj='treeCollapseAll']").click();

cy.get("[data-test-subj='spanId-link']").then((collapsedSpanIds) => {
cy.get("[data-test-subj='spanId-flyout-button']").then((collapsedSpanIds) => {
const collapsedCount = collapsedSpanIds.length;
expect(collapsedCount).to.equal(6); // Collapsed rows should match the initial count
});
Expand All @@ -209,15 +209,15 @@ describe('Testing traces tree view', () => {
cy.get("[data-test-subj='treeExpandAll']").click();
cy.get("[data-test-subj='treeCollapseAll']").click();

cy.get("[data-test-subj='spanId-link']").then((initialSpanIds) => {
cy.get("[data-test-subj='spanId-flyout-button']").then((initialSpanIds) => {
const initialCount = initialSpanIds.length;
expect(initialCount).to.equal(6);

// Find and click the first tree view expand arrow
cy.get("[data-test-subj='treeViewExpandArrow']").first().click();

// Check the number of Span IDs after expanding the arrow (should be 7)
cy.get("[data-test-subj='spanId-link']").then((expandedSpanIds) => {
cy.get("[data-test-subj='spanId-flyout-button']").then((expandedSpanIds) => {
const expandedCount = expandedSpanIds.length;
expect(expandedCount).to.equal(7);
});
Expand All @@ -233,7 +233,7 @@ describe('Testing traces tree view', () => {
cy.get("[data-test-subj='treeCollapseAll']").click();

// Open flyout for a span
cy.get("[data-test-subj='spanId-link']")
cy.get("[data-test-subj='spanId-flyout-button']")
.contains(SPAN_ID_TREE_VIEW)
.click()
cy.contains('Span detail').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const RenderCustomDataGrid: React.FC<RenderCustomDataGridParams> = ({
key="fullScreen"
color="text"
iconType={isFullScreen ? 'cross' : 'fullScreen'}
data-test-subj="fullScreenButton"
>
{isFullScreen ? 'Exit full screen' : 'Full screen'}
</EuiButtonEmpty>,
Expand Down

0 comments on commit ebc2a36

Please sign in to comment.