Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/cypress/e2e/table/table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ describe('netflow-table', () => {

cy.addFilter('src_namespace', c.namespace);
cy.addFilter('src_name', c.pod);
cy.changeQueryOption('Show duplicates');
cy.changeQueryOption('1000');
cy.clickShowDuplicates();
cy.changeTimeRange('Last 1 day');
});



it('manage columns', () => {
//first open modal
cy.openColumnsModal();
Expand Down
11 changes: 5 additions & 6 deletions web/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,11 @@ Cypress.Commands.add('changeTimeRange', (name, topology) => {
cy.checkContent(topology);
});

Cypress.Commands.add('changeMetricFunction', (name) => {
Cypress.Commands.add('clickShowDuplicates', () => {
cy.showAdvancedOptions();
cy.showDisplayOptions();

cy.get('#metricFunction-dropdown').click();
cy.get('.pf-v5-c-menu__content').contains(name).click();
cy.get('[data-layer-id="default"]').children().its('length').should('be.gte', 5);
cy.get('#table-display-dropdown').contains('Show duplicates').click();
cy.checkContent();
});

Cypress.Commands.add('changeMetricType', (name) => {
Expand Down Expand Up @@ -212,6 +210,7 @@ declare global {
changeMetricFunction(name: string): Chainable<Element>
changeMetricType(name: string): Chainable<Element>
checkRecordField(field: string, name: string, values: string[])
clickShowDuplicates()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the method signature definitions in here:

declare global {
  namespace Cypress {
    interface Chainable {

Seems to not be matching the signatures of the function declaratinons. For example:

Cypress.Commands.add('changeMetricType', (name) => {
 cy.showAdvancedOptions();
 cy.showDisplayOptions();
 cy.get('#metricType-dropdown').click();
 cy.get('.pf-v5-c-menu__content').contains(name).click();
 cy.get('[data-layer-id="default"]').children().its('length').should('be.gte', 5);
});

has not return, but the return type of Chainable<Element> is defined in the interface.

Am I missing something or is this wrong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that looks like bad copy pastes 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, I guess our custom commands have that problem too :) , mostly from copy pasting the signatures :). We mostly use custom commands to abstract set of common of UI interactions.

thanks for spotting that.

}
}
}