Cypress App
Cypress.platform
Cypress.platform returns the underlying OS name, as returned from Node's
os.platform().
Even though Cypress runs in the browser, it automatically makes this property available for use in your tests.
Syntax
Cypress.platform // 'darwin'
Examples
Conditionals
it('selects all text in the note', () => {
// if macOS do one thing, else do another
const modifier = Cypress.platform === 'darwin' ? '{cmd}' : '{ctrl}'
cy.get('#note').type(`${modifier}a`)
})