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 Jan 31, 2023
1 parent 25a06c9 commit a780114
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 145 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 @@ -60,7 +60,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 @@ -83,7 +83,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 a780114

Please sign in to comment.