Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-search.spec.js
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | cy.get('#swh-search-origins-with-visit') | ||||
}); | }); | ||||
}); | }); | ||||
it('should not send request to the resolve endpoint', function() { | it('should not send request to the resolve endpoint', function() { | ||||
cy.server(); | cy.server(); | ||||
cy.route({ | cy.route({ | ||||
method: 'GET', | method: 'GET', | ||||
url: `${this.Urls.api_1_resolve()}**` | url: `${this.Urls.api_1_resolve_swh_pid('').slice(0, -1)}**` | ||||
}).as('resolvePid'); | }).as('resolvePid'); | ||||
cy.route({ | cy.route({ | ||||
method: 'GET', | method: 'GET', | ||||
url: `${this.Urls.api_1_origin_search()}**` | url: `${this.Urls.api_1_origin_search(origin.url)}**` | ||||
}).as('searchOrigin'); | }).as('searchOrigin'); | ||||
cy.get('#origins-url-patterns') | cy.get('#origins-url-patterns') | ||||
.type(origin.url); | .type(origin.url); | ||||
cy.get('.swh-search-icon') | cy.get('.swh-search-icon') | ||||
.click(); | .click(); | ||||
cy.wait('@searchOrigin'); | cy.wait('@searchOrigin'); | ||||
▲ Show 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | context('Test valid persistent ids', function() { | ||||
}); | }); | ||||
it('should not send request to the search endpoint', function() { | it('should not send request to the search endpoint', function() { | ||||
cy.server(); | cy.server(); | ||||
const persistentId = `swh:1:rev:${origin.revisions[0]}`; | const persistentId = `swh:1:rev:${origin.revisions[0]}`; | ||||
cy.route({ | cy.route({ | ||||
method: 'GET', | method: 'GET', | ||||
url: `${this.Urls.api_1_resolve()}**` | url: this.Urls.api_1_resolve_swh_pid(persistentId) | ||||
}).as('resolvePid'); | }).as('resolvePid'); | ||||
cy.route({ | cy.route({ | ||||
method: 'GET', | method: 'GET', | ||||
url: `${this.Urls.api_1_origin_search()}**` | url: `${this.Urls.api_1_origin_search('').slice(0, -1)}**` | ||||
}).as('searchOrigin'); | }).as('searchOrigin'); | ||||
cy.get('#origins-url-patterns') | cy.get('#origins-url-patterns') | ||||
.type(persistentId); | .type(persistentId); | ||||
cy.get('.swh-search-icon') | cy.get('.swh-search-icon') | ||||
.click(); | .click(); | ||||
cy.wait('@resolvePid'); | cy.wait('@resolvePid'); | ||||
Show All 37 Lines |