Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-search.spec.js
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | before(function() { | ||||
origin = this.origin[0]; | origin = this.origin[0]; | ||||
url = this.Urls.browse_search(); | url = this.Urls.browse_search(); | ||||
}); | }); | ||||
beforeEach(function() { | beforeEach(function() { | ||||
cy.visit(url); | cy.visit(url); | ||||
}); | }); | ||||
it('should have focus on search form after page load', function() { | |||||
cy.get('#swh-origins-url-patterns') | |||||
.should('have.attr', 'autofocus'); | |||||
// for some reason, autofocus is not honored when running cypress tests | |||||
// while it is in non controlled browsers | |||||
// .should('have.focus'); | |||||
}); | |||||
it('should show in result when url is searched', function() { | it('should show in result when url is searched', function() { | ||||
cy.get('#swh-origins-url-patterns') | cy.get('#swh-origins-url-patterns') | ||||
.type(origin.url); | .type(origin.url); | ||||
cy.get('.swh-search-icon') | cy.get('.swh-search-icon') | ||||
.click(); | .click(); | ||||
cy.get('#origin-search-results') | cy.get('#origin-search-results') | ||||
.should('be.visible'); | .should('be.visible'); | ||||
▲ Show 20 Lines • Show All 372 Lines • Show Last 20 Lines |