Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions cypress/views/downloadsPage.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
/**
* Command Line Tools page. Each OS/arch shows two links with the same visible label; the main CLI
* vs restore builds are distinguished by href. Linux archives are .tar.gz; macOS/Windows
* Command Line Tools page. Each OS/arch shows three links: main CLI, backup CLI, and restore CLI.
* These builds are distinguished by href. Linux archives are .tar.gz; macOS/Windows
* use .zip (matches published release assets).
*/
const ARTIFACT_BY_PLATFORM = {
Mac: {
x86_64: {
main: 'flightctl-darwin-amd64.zip',
backup: 'flightctl-backup-darwin-amd64.zip',
restore: 'flightctl-restore-darwin-amd64.zip',
},
'ARM 64': {
main: 'flightctl-darwin-arm64.zip',
backup: 'flightctl-backup-darwin-arm64.zip',
restore: 'flightctl-restore-darwin-arm64.zip',
},
},
Linux: {
x86_64: {
main: 'flightctl-linux-amd64.tar.gz',
backup: 'flightctl-backup-linux-amd64.tar.gz',
restore: 'flightctl-restore-linux-amd64.tar.gz',
},
'ARM 64': {
main: 'flightctl-linux-arm64.tar.gz',
backup: 'flightctl-backup-linux-arm64.tar.gz',
restore: 'flightctl-restore-linux-arm64.tar.gz',
},
},
Windows: {
x86_64: {
main: 'flightctl-windows-amd64.zip',
backup: 'flightctl-backup-windows-amd64.zip',
restore: 'flightctl-restore-windows-amd64.zip',
},
'ARM 64': {
main: 'flightctl-windows-arm64.zip',
backup: 'flightctl-backup-windows-arm64.zip',
restore: 'flightctl-restore-windows-arm64.zip',
},
},
Expand All @@ -43,7 +49,7 @@ export const downloadsPage = {
cy.url({ timeout: 30000 }).should('include', 'command-line-tools')
},

/** Assert both main flightctl and flightctl-restore links exist with usable http(s) URLs. */
/** Assert main flightctl, flightctl-backup, and flightctl-restore links exist with usable http(s) URLs. */
expectArtifactLinksPresent(platform, arch) {
const names = ARTIFACT_BY_PLATFORM[platform][arch]
// ACM/console: nested scroll/clipped panels report overflow-hidden ancestors; Cypress visibility
Expand All @@ -57,18 +63,19 @@ export const downloadsPage = {
.should('match', /^https?:\/\//)
}
assertLink(names.main)
assertLink(names.backup)
assertLink(names.restore)
},

/**
* For each CLI/restore link on the page, verify the URL is reachable (HEAD, or GET with
* For each CLI/backup/restore link on the page, verify the URL is reachable (HEAD, or GET with
* Range if HEAD is not supported). Does not persist a full file download.
*/
expectAllArtifactLinksDownloadable() {
const suffixes = []
for (const arches of Object.values(ARTIFACT_BY_PLATFORM)) {
for (const names of Object.values(arches)) {
suffixes.push(names.main, names.restore)
suffixes.push(names.main, names.backup, names.restore)
}
}
suffixes.forEach((suffix) => {
Expand Down