Skip to content
Open
Show file tree
Hide file tree
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
50 changes: 29 additions & 21 deletions cypress/e2e/downloads.cy.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import { downloadsPage } from '../views/downloadsPage'

describe('Downloads Management', () => {
beforeEach(() => {
cy.login(`${Cypress.env('host')}`, `${Cypress.env('auth')}`, `${Cypress.env('username')}`, `${Cypress.env('password')}`)
})
it('Should download os flightctl cli for Windows ARM 64', () => {
cy.downloadClifile(`Windows`, `ARM 64`)
})
it('Should download os flightctl cli for Windows x86_64', () => {
cy.downloadClifile(`Windows`, `x86_64`)
})
it('Should download os flightctl cli for Linux ARM 64', () => {
cy.downloadClifile(`Linux`, `ARM 64`)
})
it('Should download os flightctl cli for Linux x86_64', () => {
cy.downloadClifile(`Linux`, `x86_64`)
})
it('Should download os flightctl cli for macOS ARM 64', () => {
cy.downloadClifile(`Mac`, `ARM 64`)
})
it('Should download os flightctl cli for macOS x86_64', () => {
cy.downloadClifile(`Mac`, `x86_64`)
})
beforeEach(() => {
cy.login(`${Cypress.env('host')}`, `${Cypress.env('auth')}`, `${Cypress.env('username')}`, `${Cypress.env('password')}`)
})

it.skip('Should download flightctl CLI for Windows ARM 64', () => {
downloadsPage.downloadCliFile('Windows', 'ARM 64')
})

it.skip('Should download flightctl CLI for Windows x86_64', () => {
downloadsPage.downloadCliFile('Windows', 'x86_64')
})

it.skip('Should download flightctl CLI for Linux ARM 64', () => {
downloadsPage.downloadCliFile('Linux', 'ARM 64')
})

it.skip('Should download flightctl CLI for Linux x86_64', () => {
downloadsPage.downloadCliFile('Linux', 'x86_64')
})

it.skip('Should download flightctl CLI for macOS ARM 64', () => {
downloadsPage.downloadCliFile('Mac', 'ARM 64')
})

it.skip('Should download flightctl CLI for macOS x86_64', () => {
downloadsPage.downloadCliFile('Mac', 'x86_64')
})
})
32 changes: 32 additions & 0 deletions cypress/views/downloadsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* DownloadsPage object for CLI download operations
*/
export const downloadsPage = {
/**
* Download flightctl CLI for a specific platform and architecture
*/
downloadCliFile: (platform, arch) => {
let filename
if (platform === 'Windows') {
if (arch === 'ARM 64') {
filename = `${platform}-flightctl-arm64.zip`
} else {
filename = `${platform}-flightctl-x86_64.zip`
}
} else {
filename = `${platform}-${arch}-flightctl.tar.gz`
}

cy.get('[data-test="help-dropdown-toggle"]').click().should('be.visible')
cy.contains('Command Line Tools').click()
cy.log(`Download flightctl for ${platform} for ${arch}`)
cy.get('.co-external-link').contains(`Download flightctl for ${platform} for ${arch}`)
.should('have.attr', 'href').then((href) => {
cy.downloadFile(`${href}`, 'downloads', filename, { timeout: 60000 })
})

let fullpath = `downloads/${filename}`
cy.log(`Downloaded file: ${fullpath}`)
cy.readFile(fullpath).should('exist')
},
}