Skip to content

Commit

Permalink
feature #177 rework cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
korel-san committed Feb 16, 2023
1 parent 38f298f commit a7c21e2
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 143 deletions.
40 changes: 37 additions & 3 deletions ui/cypress/e2e/main-tests-spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Main Tests', () => {
.should('have.length.greaterThan', 5)
})

it('search text `appName:` that is matched as filterKey, should autocomplete correctly', () => {
it('search text `appName:` that is matched as keyFragment, should filter autocomplete panel with typed value correctly', () => {
cy.visit('/')
cy.get('spline-search-box-with-filter input').click().type('appName:')
cy.wait(1000).get('.mat-autocomplete-panel spline-loader mat-spinner', { timeout: 10000 })
Expand All @@ -126,7 +126,41 @@ describe('Main Tests', () => {
cy.get('mat-table mat-row')
.should('have.length.at.least', 2)
})
it('', () => {})
it('', () => {})
it('search text `appName:"Other Job C" ` that is matched as keyFragment, should propose to autocomplete new filter', () => {
cy.visit('/')
cy.get('spline-search-box-with-filter input').click().type('appName:')
cy.wait(1000).get('.mat-autocomplete-panel spline-loader mat-spinner', { timeout: 10000 })
.should('not.exist')
cy.get('spline-search-box-with-filter input')
.type('Other ')
cy.get('.mat-autocomplete-panel mat-option')
.contains('.spline-search-attribute__option-name', 'Other Job C')
.click()
cy.wait(1000).get(`spline-search-box-with-filter input`)
.should('have.value', 'appName:"Other Job C" ')

cy.wait(1000).get('.mat-autocomplete-panel spline-loader mat-spinner', { timeout: 10000 })
.should('not.exist')
cy.get('.mat-autocomplete-panel mat-option')
.should('have.length.at.least', 3)
cy.get('spline-search-box-with-filter input')
.type('t')
cy.wait(1000).get('.mat-autocomplete-panel spline-loader mat-spinner', { timeout: 10000 })
.should('not.exist')
cy.get('.mat-autocomplete-panel mat-option')
.should('have.length.at.least', 1)
cy.get('.mat-autocomplete-panel mat-option')
.contains('.spline-search-attribute__option-name', 'tag')
.click()
cy.wait(1000).get(`spline-search-box-with-filter input`)
.should('have.value', 'appName:"Other Job C" tags:')
cy.get('.mat-autocomplete-panel mat-option')
.should('have.length.greaterThan', 3)
cy.get('.mat-autocomplete-panel mat-option')
.contains('.spline-search-attribute__option-name', 'example')
.click()
cy.wait(1000).get(`spline-search-box-with-filter input`)
.should('have.value', 'appName:"Other Job C" tags:example ')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export namespace ExecutionEventsQuery {
}

export function toLabelQueryParams(
searchString: string, labelName?: string
labelSearchValue: string, labelName?: string
): LabelPageQueryParams | LabelValuesPageQueryParams {
return {
length: -1,
offset: 0,
search: searchString,
search: labelSearchValue,
labelName
}
}
Expand Down
Loading

0 comments on commit a7c21e2

Please sign in to comment.