Skip to content

Instantly share code, notes, and snippets.

@stevgouws
stevgouws / index.test.js
Created September 9, 2019 11:08
Decision Table Testing
function fieldIsValid({ isRequired, hasError, isEmpty }) {
if (hasError) return false;
if (isRequired && isEmpty) return false;
return true;
}
describe("fieldIsValid", () => {
describe("given it has an error", () => {
@stevgouws
stevgouws / index.test.js
Created September 10, 2019 08:38
Boundary Analysis and Equivalence Class Testing Example
function isMinor(age) {
return age >= 0 && age < 18
}
describe("isMinor", () => {
it("should return true for any value between 0 and 18", () => {
expect(isMinor(10)).toEqual(true);
});
<style id="hide-choose-num-tickets-style-tag">
section.choose-num-tickets {
display: none;
}
</style>
<script>
window.onload = () => {
let chooseTicketTypeHeading;
let numberOfTicketsButton;
function simpleGenericError(aborted) {
if (aborted) return;
const modalParams = {
title: translations.get("Something went wrong"),
message: translations.get(
"We couldn't contact the venue to complete the operation, please try again later."
),
isSimple: true,
options: [
{
@stevgouws
stevgouws / Sneak Peek.md
Last active March 27, 2020 15:59
Automation Sneek Peek

Example of Test

Below shows a normal jest test file with:

  • DriverFor helper to setup and configure specific browsers
  • TicketMasterTestBundle which holds all TM specific tests
  • EventPageTestBundle example of how you can just pull in another test bundle (this one for example is used in basic flow as well)
  • You can specify individual tests to run, or all to simply run all the tests in that bundle
@stevgouws
stevgouws / playwright-parallelisation-visualisation.spec.js
Last active November 22, 2023 09:01
Playwright parallelisation visualisation
const { test, expect } = require('@playwright/test')
test.describe.parallel('Parallel tests', () => {
test('Parallel 1', async () => {
expect(true).toBe(true)
})
test('Parallel 2', async () => {
expect(true).toBe(true)
})
test.describe('Nested without override, inherits from parent scope', () => {