Skip to content

Instantly share code, notes, and snippets.

@mjhenkes
mjhenkes / a.now.js
Last active January 25, 2023 16:58
Command queue confusion
it('does stuff', async () => {
cy.firstCyCommand() //Enqueue
cy.secondCyCommand() //enqueue
const val = await firstFunction() // Awaits firstFunction promise
cy.thirdCyCommand() //enqueue
secondFunction() // runs
@mjhenkes
mjhenkes / index.html
Last active October 5, 2022 15:13
session code snippit
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
setTimeout(() => {
const sessionStorage = window.sessionStorage;
@mjhenkes
mjhenkes / issue.md
Created May 4, 2022 14:40
Simple issue template

What would you like?

Why is this needed?

Other

@mjhenkes
mjhenkes / spec.js
Last active January 24, 2022 19:06
Cypress and cy partition discussion
it('window:before:load event', () => {
Cypress.Screenshot.defaults({
stuff: true
})// this only applies to the primary domain
cy.visit('/fixtures/multi-domain.html')
cy.intercept('foobar.com/api')
@mjhenkes
mjhenkes / ugly-changelog-updater.js
Created July 31, 2020 13:09
super ugly hacky script to update terra readmes one time
#!/usr/bin/env node
/* eslint-disable no-console */
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const fs = require('fs');
const filePath = './CHANGELOG.md';
const output = fs.readFileSync(filePath, 'utf8');
const withoutH3 = output.replace(/### /g, '');
const withH1 = withoutH3.replace('Changelog', '# Changelog');
const LOGGER_ENABLED = process.env.NODE_ENV !== 'production';
const NO_OP = () => {};
/* eslint-disable no-console */
const Logger = {
info: LOGGER_ENABLED ? console.log : NO_OP,
warn: LOGGER_ENABLED ? console.warn : NO_OP,
error: console.error,
};
/* eslint-enable no-console */
version: '3'

services:
  standalone-chrome:
    image: 'selenium/standalone-chrome:3.14.0-helium'
    ports:
      - '4444'
    # Necessary due to some issues with chrome in docker.  See https://github.com/SeleniumHQ/docker-selenium#running-the-images
 volumes:
import React from 'react';
import PropTypes from 'prop-types';
import DynamicImportWrapper from './_DynamicImportWrapper';
const propTypes = {
/**
* The content to be placed within the main content area of the container.
*/
content: PropTypes.func,
const defaultConfig = require('terra-dev-site/config/wdio/wdio.conf');
const { LocalCompare } = require('wdio-visual-regression-service/compare');
const path = require('path');
const webpackConfig = require('./webpack.config');
const testIdRegex = /\[([^)]+)\]/;
function testName(parent, title) {
const matches = testIdRegex.exec(title);
const parentName = parent.replace(/[\s+.]/g, '_');