Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/home.spec.js
/** | /** | ||||
* Copyright (C) 2019-2020 The Software Heritage developers | * Copyright (C) 2019-2020 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
const $ = Cypress.$; | const $ = Cypress.$; | ||||
const url = '/'; | const url = '/'; | ||||
describe('Home Page Tests', function() { | describe('Home Page Tests', function() { | ||||
it('should have focus on search form after page load', function() { | |||||
cy.visit(url); | |||||
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 display positive stats for each category', function() { | it('should display positive stats for each category', function() { | ||||
cy.server(); | cy.server(); | ||||
cy.route({ | cy.route({ | ||||
method: 'GET', | method: 'GET', | ||||
url: this.Urls.stat_counters() | url: this.Urls.stat_counters() | ||||
}).as('getStatCounters'); | }).as('getStatCounters'); | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |