Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-save.spec.js
Show All 13 Lines | const saveCodeMsg = { | ||||
'warning': 'The "save code now" request has been put in pending state and may be accepted for processing after manual review.', | 'warning': 'The "save code now" request has been put in pending state and may be accepted for processing after manual review.', | ||||
'rejected': 'The "save code now" request has been rejected because the provided origin url is blacklisted.', | 'rejected': 'The "save code now" request has been rejected because the provided origin url is blacklisted.', | ||||
'rateLimit': 'The rate limit for "save code now" requests has been reached. Please try again later.', | 'rateLimit': 'The rate limit for "save code now" requests has been reached. Please try again later.', | ||||
'not-found': 'The provided url does not exist', | 'not-found': 'The provided url does not exist', | ||||
'unknownError': 'An unexpected error happened when submitting the "save code now request', | 'unknownError': 'An unexpected error happened when submitting the "save code now request', | ||||
'csrfError': 'CSRF Failed: Referrer checking failed - no Referrer.' | 'csrfError': 'CSRF Failed: Referrer checking failed - no Referrer.' | ||||
}; | }; | ||||
const anonymousVisitTypes = ['git', 'hg', 'svn']; | const anonymousVisitTypes = ['git', 'hg', 'svn', 'cvs']; | ||||
const allVisitTypes = ['archives', 'git', 'hg', 'svn']; | const allVisitTypes = ['archives', 'git', 'hg', 'svn', 'cvs']; | ||||
function makeOriginSaveRequest(originType, originUrl) { | function makeOriginSaveRequest(originType, originUrl) { | ||||
cy.get('#swh-input-origin-url') | cy.get('#swh-input-origin-url') | ||||
.type(originUrl) | .type(originUrl) | ||||
.get('#swh-input-visit-type') | .get('#swh-input-visit-type') | ||||
.select(originType) | .select(originType) | ||||
.get('#swh-save-origin-form') | .get('#swh-save-origin-form') | ||||
.submit(); | .submit(); | ||||
▲ Show 20 Lines • Show All 680 Lines • Show Last 20 Lines |