Changeset View
Changeset View
Standalone View
Standalone View
cypress/support/index.js
/** | /** | ||||
* Copyright (C) 2019 The Software Heritage developers | * Copyright (C) 2019 The Software Heritage developers | ||||
anlambert: (C) 2019-2020 | |||||
* 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 | ||||
*/ | */ | ||||
import {httpGetJson} from '../utils'; | import {httpGetJson} from '../utils'; | ||||
Cypress.Screenshot.defaults({ | Cypress.Screenshot.defaults({ | ||||
screenshotOnRunFailure: false | screenshotOnRunFailure: false | ||||
}); | }); | ||||
Cypress.Commands.add('xhrShouldBeCalled', (alias, timesCalled) => { | |||||
expect( | |||||
cy.state('requests').filter(call => call.alias === alias), | |||||
`${alias} should have been called ${timesCalled} times` | |||||
).to.have.length(timesCalled); | |||||
}); | |||||
before(function() { | before(function() { | ||||
this.unarchivedRepo = { | this.unarchivedRepo = { | ||||
url: 'https://github.com/SoftwareHeritage/swh-web', | url: 'https://github.com/SoftwareHeritage/swh-web', | ||||
type: 'git', | type: 'git', | ||||
revision: '7bf1b2f489f16253527807baead7957ca9e8adde', | revision: '7bf1b2f489f16253527807baead7957ca9e8adde', | ||||
snapshot: 'd9829223095de4bb529790de8ba4e4813e38672d', | snapshot: 'd9829223095de4bb529790de8ba4e4813e38672d', | ||||
rootDirectory: '7d887d96c0047a77e2e8c4ee9bb1528463677663', | rootDirectory: '7d887d96c0047a77e2e8c4ee9bb1528463677663', | ||||
content: [{ | content: [{ | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
(C) 2019-2020