Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am maeter on github.
  • I am hiraga (https://keybase.io/hiraga) on keybase.
  • I have a public key ASD-sKFPsWKyEFvq_dIIc96i3TrUDgoUKMqFqAKubuyt-Qo

To claim this, I am signing this object:

// We need to overload the Storage object so we can save
// object-like data to the local storage
Storage.prototype.setObject = function (key, value) {
this.setItem(key, JSON.stringify(value));
};
Storage.prototype.getObject = function (key) {
const value = this.getItem(key);
return value && JSON.parse(value);
};
describe('RED user path', () => {
executeTests( // We select answer type 'a' as in the image
[testStep1, { userCase: { type: 'a' } }],
[testStep2, { userCase: { type: 'a' } }],
[testStep3],
);
});
describe('YELLOW user path', () => {
executeTests( // We select answer type 'c' as in the image
/**
* Execute the texts sequentially mapping over the list of tests
* @param {Array} tests List of [test: fn, config: obj] to execute
*/
export const executeTests = (...tests) =>
tests.map(([fn, ...args]) => fn(...args));
import { executeTests } from '../../support/utils';
import testLogin from '../../support/tool-1/login';
import testOverview from '../../support/tool-1/overview';
import testConfirm from '../../support/tool-1/confirm';
describe('User flow 1', () => {
it('successfully loads flow url', () => {
cy.visit('flow1');
});
executeTests(
const generateTest = ({
contextName,
initialStateFn,
interactionsFn,
proceedFn,
userCase, // Specific param to proceed to different ramifications
}) => {
const ucOrEmptyObj = userCase || {};
context(contextName, () => {
// Run all tests from step
import { generateTest } from '../test-utils';
export const initialState = (config) => {
describe('Initial state', () => {
// Here go the tests that assert that, once rendered,
// the step is displaying the correct titles, texts,
// images, etc. This is important because some of
// the aforementioned can come from the backend.
});
};