This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { getAngular } = require('./getAngular.js'); | |
const getElement = (sel) => { | |
return cy.get(sel) | |
.then($el => getAngular() | |
.then(ng => ng.element($el))); | |
}; | |
export { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getAngular = () => | |
cy.window().its('angular'); | |
export { | |
getAngular | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { getElement } = require('./getElement.js'); | |
const getScope = (sel) => { | |
return getElement.scope(); | |
}; | |
export { | |
getScope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const load = async (context, platformPath) => { | |
const path = require('path'); | |
cy.load('context: ', context); | |
cy.load('platformPath: ', platformPath); | |
return await cy.readFile(path.resolve(context, platformPath)); | |
}; | |
module.exports = { | |
load | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { getElement } = require('./utils/getElement.js'); | |
const { getScope } = require('./utils/getScope.js'); | |
const { load } = require('./utils/load.js'); | |
const config = async () => { | |
cy.log(__dirname); | |
const platformConf = await load(__dirname, '../../tests/conf/platform.conf.json'); | |
cy.log(platformConf); | |
return platformConf; | |
}; | |
const { has } = require('../../tests/e2e/utils/has.js')(config(), 'homeUnitTabletConfig'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Home - Unit | |
Given I am on "#home-unit" | |
When I click "Show navigation menu" | |
Then I should see "Logout" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Navigate to Unit Crew | |
Given I am on "#home-unit" | |
Given I am on "#unit-crew" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Home - Unit | |
Given I am on "#home-unit" | |
When I click "Open" | |
Then I should see "Crew 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Given, When, Then } from '../../tests/bdd'; | |
import { compose } from '../../tests/bdd/utils/compose.js'; | |
const { load } = require('../../tests/bdd/utils/load.js'); | |
const config = async () => { | |
const platformConf = await load(__dirname, 'platform.conf.json'); | |
cy.log('reading file'); | |
cy.log(platformConf); | |
return platformConf; | |
}; | |
const { has } = require('../../tests/e2e/utils/has.js')(config(), 'homeUnitTabletConfig'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Home (iPad)', () => { | |
const baseUrl = Cypress.env('baseUrl:home-unit') || 'http://localhost:8000'; | |
it('should check for localStorage', () => { | |
cy.visit(baseUrl); | |
const localStorage = cy.window().its('localStorage'); | |
cy.log('checking for localStorage'); | |
expect(localStorage).to.exist; | |
cy.log("condition: 'get' in localStorage", 'get' in localStorage); | |
expect('get' in localStorage).to.be.true; | |
}); |