Skip to content

Instantly share code, notes, and snippets.

View dualyticalchemy's full-sized avatar
💤
asleep in my own mind

⚫️ nothingness negates itself dualyticalchemy

💤
asleep in my own mind
View GitHub Profile
const { getAngular } = require('./getAngular.js');
const getElement = (sel) => {
return cy.get(sel)
.then($el => getAngular()
.then(ng => ng.element($el)));
};
export {
const getAngular = () =>
cy.window().its('angular');
export {
getAngular
};
const { getElement } = require('./getElement.js');
const getScope = (sel) => {
return getElement.scope();
};
export {
getScope
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
};
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');
Scenario: Home - Unit
Given I am on "#home-unit"
When I click "Show navigation menu"
Then I should see "Logout"
Scenario: Navigate to Unit Crew
Given I am on "#home-unit"
Given I am on "#unit-crew"
Scenario: Home - Unit
Given I am on "#home-unit"
When I click "Open"
Then I should see "Crew 2"
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');
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;
});