├── .gitignore
├── .gitmodules
├── LICENSE
├── README-20181213.md
├── README-20190131.md
├── README-20190402.md
├── README.md
├── adobe-xd
├── README.md
├── intro-adobe-xd.pptx
├── ui-kits
│ ├── apple-ui-elements-ipad.xd
│ ├── apple-ui-elements-iphone8.xd
│ ├── apple-ui-elements-iphoneX.xd
│ └── google-stickersheet-components.xd
└── xd-tutorial.xd
├── cypress
├── README.md
├── koa
│ ├── .gitignore
│ ├── Dockerfile
│ ├── app.js
│ ├── docker-compose.yml
│ ├── modules
│ │ ├── accommodations
│ │ │ ├── accommodationsController.js
│ │ │ └── accommodationsSchema.js
│ │ ├── auth
│ │ │ ├── authController.js
│ │ │ └── helpers.js
│ │ └── users
│ │ │ ├── usersController.js
│ │ │ └── usersSchema.js
│ ├── package.json
│ ├── seed.js
│ └── yarn.lock
└── react
│ ├── .eslintignore
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── .prettierrc
│ ├── .vscode
│ └── components.code-snippets
│ ├── README.md
│ ├── cypress.json
│ ├── cypress
│ ├── _integration
│ │ └── examples
│ │ │ ├── actions.spec.js
│ │ │ ├── aliasing.spec.js
│ │ │ ├── assertions.spec.js
│ │ │ ├── connectors.spec.js
│ │ │ ├── cookies.spec.js
│ │ │ ├── cypress_api.spec.js
│ │ │ ├── files.spec.js
│ │ │ ├── local_storage.spec.js
│ │ │ ├── location.spec.js
│ │ │ ├── misc.spec.js
│ │ │ ├── navigation.spec.js
│ │ │ ├── network_requests.spec.js
│ │ │ ├── querying.spec.js
│ │ │ ├── spies_stubs_clocks.spec.js
│ │ │ ├── traversal.spec.js
│ │ │ ├── utilities.spec.js
│ │ │ ├── viewport.spec.js
│ │ │ ├── waiting.spec.js
│ │ │ └── window.spec.js
│ ├── fixtures
│ │ └── example.json
│ ├── integration
│ │ ├── appbar.spec.js
│ │ └── dashboard.spec.js
│ ├── plugins
│ │ └── index.js
│ └── support
│ │ ├── commands.js
│ │ ├── helpers.js
│ │ └── index.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
│ ├── src
│ ├── App.js
│ ├── App.test.js
│ ├── common
│ │ ├── auth.js
│ │ ├── context.js
│ │ └── fetch.js
│ ├── components
│ │ ├── AccommodationCard
│ │ │ └── AccommodationCard.js
│ │ ├── Accommodations
│ │ │ └── Accommodations.js
│ │ ├── AccommodationsDetail
│ │ │ └── AccommodationsDetail.js
│ │ ├── Appbar
│ │ │ └── Appbar.js
│ │ ├── CreateAccommodation
│ │ │ └── CreateAccommodation.js
│ │ ├── Error
│ │ │ └── Page404.js
│ │ ├── Frame
│ │ │ └── Frame.js
│ │ └── Login
│ │ │ ├── LoginDialog.js
│ │ │ └── Register.js
│ ├── configureStore.js
│ ├── index.css
│ ├── index.js
│ ├── resources
│ │ ├── CaretLeftIcon.js
│ │ ├── CaretRightIcon.js
│ │ └── HouseIcon.js
│ └── store
│ │ └── accommodations
│ │ ├── actions.js
│ │ └── reducer.js
│ └── yarn.lock
├── expose-localclient-ngrok-localtunnel
└── README.md
├── jsonata-query-and-transform-json-documents
├── Dockerfile
├── README.md
├── countries-module.js
├── explore-countries.js
├── explore-oracleopenworld-catalog.js
├── json-server.js
├── oow2018-sessions-catalog.json
├── package-lock.json
└── package.json
├── kafka-connect-workshop
├── Introduction Kafka Connect.pptx
├── LICENSE
├── README.md
├── Workshop Kafka Connect.docx
└── files
│ ├── Dockerfile
│ ├── docker-compose.yml
│ ├── elasticsearchsink.json
│ ├── filesource.json
│ ├── load.ps1
│ ├── load.sh
│ ├── loadelasticsearchsink.ps1
│ ├── loadelasticsearchsink.sh
│ ├── loadfilesource.ps1
│ ├── loadfilesource.sh
│ ├── loadoutputasindex.ps1
│ ├── loadoutputasindex.sh
│ ├── outputas.txt
│ ├── outputasindex.json
│ ├── readme.txt
│ ├── restart.ps1
│ └── restart.sh
├── katacoda
├── README.md
├── assets
│ └── docker-compose.yml
├── docker-compose.yml
├── finish.md
├── index.json
├── intro.md
├── step1.md
├── step2.md
├── step3.md
└── step4.md
├── kibana
└── introductie kibana.md
├── lastPass-password-manager
└── README.md
├── linux-and-docker-host-on-windows-machine
├── README.md
└── Vagrantfile
├── neo4j-graphdatabase
├── README.md
├── neo4j-node.js
├── package-lock.json
└── package.json
├── powershell
└── Introducing PowerShell.md
├── quick-sql
└── README.md
├── ssh-tunnels
├── Basics of SSH tunnels.docx
├── README.md
└── SSHTunnels.pptx
├── traefik
├── README.md
├── docker-backend
│ └── docker-compose.yml
└── search
│ ├── docker-compose.yml
│ └── traefik.toml
└── zsh-and-ohmyzsh
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "code-cafe-20190520"]
2 | path = code-cafe-20190520
3 | url = https://github.com/AMIS-Services/code-cafe-20190520
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 AMIS Services BV
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README-20181213.md:
--------------------------------------------------------------------------------
1 | # Code Cafe Thursday 13th December 2018
2 | The Code Café is a series of low key, relaxed meetups where we explore various technologies, tools, programming aids and other fun stuff in a relaxed setting. This repository contains artifacts for the Code Café sessions.
3 |
4 | Note: in the Code Café, we can work with various technologies - browser based or local (typically in containers) - and across the stack: UI, (micro)service, database, code editing and programming utilities and general productivity boosters.
5 |
6 | Code Café sessions will usually not work with slides and presentations. Items are introduced with a brief introduction and a demonstration - followed by trying out!
7 |
8 | ## On the Menu for the first Code Café
9 |
10 | * Vagrant (& VirtualBox) - tool for efficient management of VMs and a local Docker Engine); especially useful for running Docker on Windows laptops : https://github.com/AMIS-Services/code-cafe/tree/master/linux-and-docker-host-on-windows-machine
11 | * JSONata - XPath & XSLT/XQuery like expression language for retrieving data from and transforming JSON documents - https://github.com/AMIS-Services/code-cafe/tree/master/jsonata-query-and-transform-json-documents
12 | * ngrok (& local tunnel) for exposing locally running services on the internet - https://github.com/AMIS-Services/code-cafe/tree/master/expose-localclient-ngrok-localtunnel
13 | * QuickSQL - free cloud service for rapid generation of SQL DDL and DML scripts for tables, generated test data, constraints, views, triggers and APIs: https://github.com/AMIS-Services/code-cafe/blob/master/quick-sql/README.md
14 | * Neo4j - open source Graph Database: https://github.com/AMIS-Services/code-cafe/tree/master/neo4j-graphdatabase
15 |
--------------------------------------------------------------------------------
/README-20190131.md:
--------------------------------------------------------------------------------
1 | # Code Cafe Thursday 31st January 2019
2 | The Code Café is a series of low key, relaxed meetups where we explore various technologies, tools, programming aids and other fun stuff in a relaxed setting. This repository contains artifacts for the Code Café sessions.
3 |
4 | Note: in the Code Café, we can work with various technologies - browser based or local (typically in containers) - and across the stack: UI, (micro)service, database, code editing and programming utilities and general productivity boosters.
5 |
6 | Code Café sessions will usually not work with slides and presentations. Items are introduced with a brief introduction and a demonstration - followed by trying out!
7 |
8 | ## On the Menu for this Code Café session
9 |
10 | * [Cypress Testing](https://github.com/AMIS-Services/code-cafe/tree/master/cypress) (Bram Kaashoek) - automated unit testing of browser applications (Selenium++): https://www.cypress.io/
11 | * [ZSH and OhMyZSH](https://github.com/AMIS-Services/code-cafe/tree/master/zsh-and-ohmyzsh) (Nathan Breuring) - https://ohmyz.sh/ Linux Shell
12 | * [PowerShell](https://github.com/AMIS-Services/code-cafe/tree/master/powershell) (Robert van den Nieuwendijk) - task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language - https://docs.microsoft.com/en-us/powershell/?view=powershell-6
13 | * [Traefik](https://github.com/AMIS-Services/code-cafe/tree/master/traefik) (Lucas Jellema) - Load Balancer and Proxy ("Cloud Native Edge Router") https://traefik.io/
14 | * [Katacoda](https://github.com/AMIS-Services/code-cafe/tree/master/katacoda) (Lucas Jellema) - Browser based Playgrounds & Tutorials; also for creating your own tutorials - https://www.katacoda.com/
15 |
16 |
17 |
--------------------------------------------------------------------------------
/README-20190402.md:
--------------------------------------------------------------------------------
1 | # Code Cafe Tuesday 2nd April 2019
2 | The Code Café is a series of low key, relaxed meetups where we explore various technologies, tools, programming aids and other fun stuff in a relaxed setting. This repository contains artifacts for the Code Café sessions.
3 |
4 | Note: in the Code Café, we can work with various technologies - browser based or local (typically in containers) - and across the stack: UI, (micro)service, database, code editing and programming utilities and general productivity boosters.
5 |
6 | Code Café sessions will usually not work with slides and presentations. Items are introduced with a brief introduction and a demonstration - followed by trying out!
7 |
8 | ## On the Menu for this Code Café session
9 |
10 | * Node-RED - Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways - (Ron Hendriks) - https://nodered.org/
11 | * [Adobe XD](adobe-xd) - design tool for web and mobile apps (Robert van Mölken) - https://www.adobe.com/products/xd.html
12 | * [LastPass](lastPass-password-manager) – auto-pilot for all your passwords (Kjettil Hennis) https://www.lastpass.com/
13 | * [Kafka Connect](kafka-connect-workshop) – adapters en connectoren tussen Kafka Topics en bronnen en doelen van events (Maarten Smeets) - https://kafka.apache.org/documentation/#connect
14 | * Kibana Dashboards – (Bram de Beer)
15 |
16 | ## LastPass
17 | Er zijn verschillende mogelijkheden om wachtwoorden te beheren: onthouden, opschrijven met pen en papier of elektronisch opslaan. Met Lastpass Password Manager sla ze elektronisch op. We gaan in deze workshop kijken naar wat het is en welke mogelijkheden je hebt met het gebruik van Lastpass.
18 |
19 |
20 | ## Node-RED
21 | Heb je een IOT project en wil je snel een POC doen? Dan is node-red de tool die je daar bij helpen kan! Het is een opensource, lichtgewicht omgeving met een grafische ontwikkel omgeving. Gebaseerd op NodeJS bied het mogelijkheden voor het verzenden, ontvangen en transformeren van berichten. Daarnaast zijn ook zaken als UI, hardware monitoring en databases geen enkel probleem. In deze sessie lopen we langs de diverse mogelijkheden van het pakket.
22 |
23 |
24 | ## Kafka Connect
25 | Kafka is een gedistribueerd streaming platform welke (bijvoorbeeld) als enterprise messaging oplossing ingezet kan worden. Kafka Connect is een framework om Kafka te verbinden met externe systemen zoals databases, key-value stores en file systems. Connectoren implementeren het Kafka Connect framework en er zijn er veel beschikbaar (zie https://www.confluent.io/hub/). Tijdens deze workshop zal je kennis maken met gebruik en monitoring van deze integratiecomponenten aan de hand van een IoT voorbeeld. #integratie #kafka #IoT
26 |
27 | ## Adobe XD
28 | Adobe XD is een gratis vectorgebaseerde tool voor het ontwerpen en prototypen van user experiences voor web- en mobiele apps. De software is beschikbaar voor macOS en Windows en ondersteunt vectorontwerp en wireframing van websites. Met deze tool kan je eenvoudig interactieve en doorklikbare prototypen maken. Tevens bestaan er veel plugins zoals voor React om code te genereren. Tijdens deze korte workshop maak je kennis met de tool en maken we een simpele web-app. Een gratis account by Adobe is een vereiste.
29 |
30 | ## Kibana Dashboards
31 | Hoe groter een automatiseringsproject wordt, hoe meer data er vaak verwerkt wordt. Kibana biedt een mogelijkheid om trends en bijzonderheden in een grote informatiestroom inzichtelijk te maken, om voor ontwikkelaars, beheer, en business duidelijkheid te scheppen over de staat en gezondheid van een project. Tijdens deze workshop gaan we zien hoe duizelingwekkend veel data relatief simpel overzichtelijk kan worden gemaakt.
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/adobe-xd/README.md:
--------------------------------------------------------------------------------
1 | # Adobe XD
2 |
3 | When starting building new front-end applications it can really help communicating with your end customer to show them in early phase how the application is going to look like and how the flow within in App feels like.
4 |
5 | In many cases a UI/UX designer create drawings or wireframes. Adobe XD is the next level application to create app designs and prototypes.
6 |
7 | ## What is XD?
8 |
9 | Adobe Experience Design (XD) is a cross-platform app for designing and prototyping websites, mobile apps, etc.
10 |
11 | ### Who is it for?
12 |
13 | XD is a single app for UX/UI and digital designers to design and create wireframes and app proposals.
14 |
15 | ### What can be build with XD?
16 |
17 | - Design and prototype in a single desktop app.
18 | - Preview your design live on mobile devices.
19 | - XD’s minimal interface is focused on UX/UI design, so you can work faster.
20 | - A fast app with small files so projects can be easily edited.
21 | - Object-oriented (so you can quickly navigate, move, or adjust elements).
22 | - Vector-based, so it’s easy to draw icons, etc.
23 |
24 | ## Getting started
25 |
26 | ### Requirements
27 |
28 | You will need:
29 |
30 | - free account at Adobe Creative Cloud
31 | - download Creative Cloud Desktop App
32 | - install Adobe XD CC: https://www.adobe.com/nl/products/xd.html
33 |
34 | For the demo you will also need:
35 |
36 | 1. XD Tutorial File
37 | 2. (Optional) UI Kit for iOS or Google Material
38 |
39 | ### Try out XD:
40 |
41 | - open Adobe XD
42 | - for option 1: start main tutorial or open file `xd-tutorial.xd`
43 | - for option 2: open one of the UI kit files `apple-***.xd` or `google-***.xd`
44 |
45 | ### Other tutorials:
46 | - [create interactive presentation](https://helpx.adobe.com/xd/how-to/create-interactive-presentation.html?playlist=/ccx/v1/collection/product/xd/topics/xd-projects-more/collection.ccx.js&ref=helpx.adobe.com)
47 | - [create a slideshow](https://helpx.adobe.com/xd/how-to/create-slideshow.html?playlist=/content/help/en/ccx/v1/collection/product/xd/topics/xd-projects-more/collection.ccx.js)
48 |
49 | ## Resources
50 |
51 | main site: https://www.adobe.com/nl/products/xd.html
52 | docs: https://helpx.adobe.com/nl/xd/user-guide.html
53 | tutorials: https://helpx.adobe.com/xd/tutorials.html
54 |
--------------------------------------------------------------------------------
/adobe-xd/intro-adobe-xd.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/intro-adobe-xd.pptx
--------------------------------------------------------------------------------
/adobe-xd/ui-kits/apple-ui-elements-ipad.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/ui-kits/apple-ui-elements-ipad.xd
--------------------------------------------------------------------------------
/adobe-xd/ui-kits/apple-ui-elements-iphone8.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/ui-kits/apple-ui-elements-iphone8.xd
--------------------------------------------------------------------------------
/adobe-xd/ui-kits/apple-ui-elements-iphoneX.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/ui-kits/apple-ui-elements-iphoneX.xd
--------------------------------------------------------------------------------
/adobe-xd/ui-kits/google-stickersheet-components.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/ui-kits/google-stickersheet-components.xd
--------------------------------------------------------------------------------
/adobe-xd/xd-tutorial.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMIS-Services/code-cafe/b205b7288e84a082c01330a32171bfba72e21591/adobe-xd/xd-tutorial.xd
--------------------------------------------------------------------------------
/cypress/README.md:
--------------------------------------------------------------------------------
1 | # Cypress.io
2 |
3 | In order to deploy an app to production with confidence, automated testing is a necessity.
4 | Using browser-based intregration testing has some major advantages:
5 |
6 | - large swathes of code are hit with small amounts of testing
7 | - whereas unit tests and snapshot tests for front end often test implementation, cypress specs test functionality
8 | - allows to test for oddities of browser and changes brought on by changes in resolution
9 |
10 | Up until now Selenium was the tool of choice, but it is being challende by Cypress.
11 | Cypress is very simple to use, comes with a bundle set of tools and is completely standalone, alieviating the need to fiddle with webdriver.
12 | Some of the included tools are Mocha with helpers such as beforeEach, describe, context etc, Chai for assertions and Sinon for stubs and spies.
13 |
14 | ## Getting started
15 |
16 | ### Requirements
17 |
18 | You will need:
19 |
20 | - node (8+)
21 | - a node package manager (yarn / npm)
22 |
23 | For the demo you will also need:
24 |
25 | - docker and docker compose
26 |
27 | ### Running the demo:
28 |
29 | - cd into koa
30 | - `yarn`
31 | - `yarn start`
32 | - `yarn seed`
33 | - cd into react
34 | - `yarn`
35 | - `yarn start`
36 | - new terminal window, same path
37 | - `yarn cypress`
38 |
39 | The test files are found in code-cafe/react/cypress/integration
40 |
41 | ### Try it for yourself:
42 |
43 | In an existing project, run `npm install cypress` and then run `cypress open`.
44 | This will add several folders and files, including some examples of what's possible with cypress.
45 |
46 | ## Features
47 |
48 | - open source
49 | - fast
50 | - easy to write and debug
51 | - built for responsiveness testing
52 | - spies, stubs, clocks
53 | - direct manipulation of data management solutions (e.g. redux)
54 | - screenshots and video of failing tests
55 | - excellent documentation
56 |
57 | ## Resources
58 |
59 | main site: https://www.cypress.io/
60 |
61 | docs: https://docs.cypress.io/
62 |
63 | source code: https://github.com/cypress-io/cypress
64 |
65 | npm page: https://www.npmjs.com/package/cypress
66 |
--------------------------------------------------------------------------------
/cypress/koa/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 |
--------------------------------------------------------------------------------
/cypress/koa/Dockerfile:
--------------------------------------------------------------------------------
1 | from node:8
2 | WORKDIR '/var/www/app'
3 | copy . .
4 | RUN yarn
5 | EXPOSE 3030
--------------------------------------------------------------------------------
/cypress/koa/app.js:
--------------------------------------------------------------------------------
1 | import Koa from "koa";
2 | import Router from "koa-router";
3 | import mongoose from "mongoose";
4 | import bodyParser from "koa-bodyparser";
5 | import cors from "@koa/cors";
6 |
7 | import { router as accommodationsRouter } from "./modules/accommodations/accommodationsController";
8 | import { router as authRouter } from "./modules/auth/authController";
9 | import { router as usersRouter } from "./modules/users/usersController";
10 |
11 | const koa = new Koa();
12 | const app = new Router();
13 | mongoose.connect(
14 | "mongodb://mongo:27017/AMISBnB",
15 | { useNewUrlParser: true }
16 | );
17 |
18 | koa.use(cors());
19 | app.use(bodyParser());
20 |
21 | app.get("/", async ctx => {
22 | console.log("GET /");
23 | ctx.body = "Koa running";
24 | });
25 |
26 | app.use("/accommodations", accommodationsRouter.routes());
27 | app.use("/auth", authRouter.routes());
28 | app.use("/users", usersRouter.routes());
29 | koa.use(app.routes());
30 | koa.use(app.allowedMethods());
31 |
32 | const server = koa.listen(3030);
33 | console.log(`Koa up at ${server.address().address}:${server.address().port}`);
34 |
--------------------------------------------------------------------------------
/cypress/koa/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 | mongo:
4 | image: mongo
5 | ports:
6 | - 27017:27017
7 | koa:
8 | image: node:8
9 | build: ./
10 | volumes:
11 | - ./:/var/www/app
12 | ports:
13 | - 3030:3030
14 | depends_on:
15 | - mongo
16 | command: yarn start-koa
17 |
--------------------------------------------------------------------------------
/cypress/koa/modules/accommodations/accommodationsController.js:
--------------------------------------------------------------------------------
1 | import Router from "koa-router";
2 | import Accommodation from "./accommodationsSchema";
3 | import { isAuth, getUserId } from "../auth/helpers";
4 |
5 | export const router = new Router();
6 |
7 | router.get("/", async ctx => {
8 | console.log("GET /accommodations");
9 | const accommodations = await Accommodation.find();
10 |
11 | const accommodationsOverview = accommodations.map(a => ({
12 | _id: a._id,
13 | location: a.location,
14 | name: a.name,
15 | description: a.description,
16 | image: a.images[0]
17 | }));
18 | ctx.body = accommodationsOverview;
19 | });
20 |
21 | router.get("/:id", async ctx => {
22 | const id = ctx.params.id;
23 | console.log(`GET /accommodations/${id}`);
24 | if (!id.match(/^[0-9a-fA-F]{24}$/)) {
25 | ctx.throw(404);
26 | }
27 | const accommodation = await Accommodation.findById(id);
28 | ctx.body = accommodation;
29 | });
30 |
31 | router.use(isAuth).post("/", async ctx => {
32 | console.log("POST /accommodations");
33 | const accommodation = ctx.request.body;
34 | const userId = getUserId(ctx.request);
35 | accommodation.createdBy = userId;
36 | const savedAccommodation = await Accommodation.create(accommodation);
37 | ctx.body = savedAccommodation;
38 | });
39 |
40 | router.use(isAuth).put("/:id", async ctx => {
41 | const id = ctx.params.id;
42 | console.log(`PUT /accommodations/${id}`);
43 | await Accommodation.update({ _id: id }, ctx.request.body);
44 | const accommodation = await Accommodation.findById(id);
45 | ctx.body = accommodation;
46 | });
47 |
--------------------------------------------------------------------------------
/cypress/koa/modules/accommodations/accommodationsSchema.js:
--------------------------------------------------------------------------------
1 | import mongoose from "mongoose";
2 |
3 | const AccommodationSchema = new mongoose.Schema(
4 | {
5 | name: { type: String },
6 | location: { type: String },
7 | images: { type: [String] },
8 | amenities: { type: [String] },
9 | description: { type: String },
10 | createBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" }
11 | },
12 | { timestamps: true }
13 | );
14 |
15 | const Accommodation = mongoose.model("Accommodation", AccommodationSchema);
16 |
17 | export default Accommodation;
18 |
--------------------------------------------------------------------------------
/cypress/koa/modules/auth/authController.js:
--------------------------------------------------------------------------------
1 | import Router from "koa-router";
2 | import User from "../users/usersSchema";
3 | import bcrypt from "bcrypt";
4 | import jsonwebtoken from "jsonwebtoken";
5 |
6 | export const router = new Router();
7 |
8 | router.post("/", async ctx => {
9 | const email = ctx.request.body.email;
10 | const password = ctx.request.body.password;
11 | console.log(`POST /auth for ${email}`);
12 | const user = await User.findOne({ email });
13 | if (!user) {
14 | const error = `User not found`;
15 | console.log(error);
16 | ctx.throw(404, error);
17 | }
18 | if (!(await bcrypt.compare(password, user.password))) {
19 | const error = "Password incorrect";
20 | console.log(error);
21 | ctx.throw(401, error);
22 | }
23 | const jwt = jsonwebtoken.sign({ id: user.id }, "super veilige key");
24 | ctx.body = { jwt };
25 | });
26 |
--------------------------------------------------------------------------------
/cypress/koa/modules/auth/helpers.js:
--------------------------------------------------------------------------------
1 | import jwt from "koa-jwt";
2 |
3 | export const isAuth = jwt({ secret: "super veilige key" });
4 |
5 | export const getUserId = request => {
6 | const authHeader = request.header.authorization;
7 | const base64 = authHeader
8 | .split(" ")[1]
9 | .split(".")[1]
10 | .replace("-", "+")
11 | .replace("_", "/");
12 | const user = Buffer.from(base64, "base64").toString();
13 | return JSON.parse(user).id;
14 | };
15 |
--------------------------------------------------------------------------------
/cypress/koa/modules/users/usersController.js:
--------------------------------------------------------------------------------
1 | import Router from "koa-router";
2 | import User from "./usersSchema";
3 | import bcrypt from "bcrypt";
4 | import { isAuth, getUserId } from "../auth/helpers";
5 |
6 | export const router = new Router();
7 |
8 | router.post("/", async ctx => {
9 | console.log(`POST /users`);
10 | const user = ctx.request.body;
11 | const existingUser = await User.findOne({ $or: [({ email: user.email }, { username: user.username })] });
12 | if (!user.email || !user.username || !user.password) {
13 | const error = `please provide email, username and password`;
14 | console.log(error);
15 | ctx.throw(400, error);
16 | }
17 | if (existingUser) {
18 | const error = "This email and/or username are already in use";
19 | console.log(error);
20 | ctx.throw(418, error);
21 | }
22 | user.password = await bcrypt.hash(user.password, 10);
23 | const savedUser = await User.create(user);
24 | ctx.body = savedUser;
25 | });
26 |
27 | router.use(isAuth).get("/:id", async ctx => {
28 | const id = ctx.params.id;
29 | console.log(`GET user ${id}`);
30 | const user = await User.findById(id);
31 | ctx.body = user;
32 | });
33 |
34 | router.use(isAuth).put("/:id", async ctx => {
35 | const id = ctx.params.id;
36 | console.log(`PUT user ${id}`);
37 | const userId = getUserId(ctx.request);
38 | if (id !== userId) {
39 | const error = `you are not allowed to change another users info`;
40 | console.log(error);
41 | ctx.throw(401, error);
42 | }
43 | await User.update({ _id: id }, ctx.request.body);
44 | const user = await User.findById(id);
45 | ctx.body = user;
46 | });
47 |
--------------------------------------------------------------------------------
/cypress/koa/modules/users/usersSchema.js:
--------------------------------------------------------------------------------
1 | import mongoose from "mongoose";
2 |
3 | const UserSchema = new mongoose.Schema(
4 | {
5 | email: { type: String, unique: true },
6 | username: { type: String, unique: true },
7 | password: { type: String },
8 | favoriteAccommodations: [{ type: mongoose.Schema.Types.ObjectId, ref: "Accommodation" }]
9 | },
10 | { timestamps: true }
11 | );
12 |
13 | UserSchema.set("toJSON", {
14 | transform: (doc, ret, opt) => {
15 | delete ret["password"];
16 | }
17 | });
18 |
19 | const User = mongoose.model("User", UserSchema);
20 |
21 | export default User;
22 |
--------------------------------------------------------------------------------
/cypress/koa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "start": "docker-compose up -d",
4 | "stop": "docker-compose down",
5 | "seed": "node seed",
6 | "start-koa": "nodemon app.js --exec babel-node --presets es2015",
7 | "seed-db": "node seed",
8 | "stop-db": "docker rm -f mongoSIG"
9 | },
10 | "dependencies": {
11 | "@koa/cors": "^2.2.2",
12 | "bcrypt": "^3.0.2",
13 | "jsonwebtoken": "^8.3.0",
14 | "koa": "^2.6.1",
15 | "koa-bodyparser": "^4.2.1",
16 | "koa-jwt": "^3.5.1",
17 | "koa-router": "^7.4.0",
18 | "mongoose": "^5.2.5",
19 | "nodemon": "^1.18.3",
20 | "request": "^2.88.0",
21 | "request-promise": "^4.2.2"
22 | },
23 | "devDependencies": {
24 | "babel-cli": "^6.26.0",
25 | "babel-preset-es2015": "^6.24.1"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/cypress/koa/seed.js:
--------------------------------------------------------------------------------
1 | const request = require("request-promise");
2 |
3 | const users = [
4 | {
5 | email: "bram.kaashoek@amis.nl",
6 | password: "123",
7 | username: "Bram",
8 | favoriteAccommodations: []
9 | }
10 | ];
11 |
12 | const accommodations = [
13 | {
14 | name: "Romantische vuurtoren",
15 | location: "Scheveningen",
16 | favorite: false,
17 | images: [
18 | "http://infomarken.com/wp-content/uploads/2016/03/tourPaard1.jpg",
19 | "http://www.nieman.nl/wp-content/uploads/2017/08/Interieur-De-Vuurtoren-Kop-Noordereiland-Harderwijk.jpg",
20 | "https://static.webshopapp.com/shops/186977/files/089588126/image.jpg"
21 | ],
22 | amenities: [
23 | "stofzuiger",
24 | "strijkijzer",
25 | "WiFi",
26 | "droger",
27 | "verwarming",
28 | "TV",
29 | "wieg",
30 | "airconditioning",
31 | "verduisterende gordijnen",
32 | "centrale verwarming",
33 | "beddegoed",
34 | "parkeerplek",
35 | "feun",
36 | "shampoo en conditioner",
37 | "wasmachine",
38 | "droger",
39 | "zeep",
40 | "tuin",
41 | "schommel",
42 | "EHBO kit"
43 | ],
44 | description:
45 | "Een zeer romantische lokatie aan de zee. Verblijf in een authentieke vuurtoren en overzie vanaf grote hoogte de zee. Enkel voor gasten met een goede conditie."
46 | },
47 | {
48 | name: "Bezemkast in Amsterdam",
49 | location: "Amsterdam",
50 | favorite: false,
51 | images: [
52 | "https://i.pinimg.com/originals/db/2b/20/db2b207c1bb61e5b7d1bafe1c81455ff.jpg",
53 | "https://ronafischman.com/wp-content/uploads/2015/10/Understairs.bedroom.jpg"
54 | ],
55 | amenities: ["WiFi", "verwarming", "beddegoed", "zeep", "EHBO kit"],
56 | description:
57 | "De beste woning die je in Amsterdam gaat vinden onder de 500 euro per nacht. Accepteer de realiteit van de woningnood en zie de positieve kant in: het is erg knus."
58 | },
59 | {
60 | name: "Hutje op de hei",
61 | location: "De Veluwe",
62 | favorite: false,
63 | images: [
64 | "https://i.pinimg.com/originals/b6/e8/12/b6e812e996f90dc575acb6207235adf5.jpg",
65 | "https://roomed.nl/wp-content/uploads/2017/06/roomed-amsterdamse-loft4.jpg",
66 | "https://cdn.shopify.com/s/files/1/2954/9184/files/slow-cabins-interieur5_2048x2048.jpg?v=1520013611"
67 | ],
68 | amenities: [
69 | "stofzuiger",
70 | "strijkijzer",
71 | "verwarming",
72 | "wieg",
73 | "beddegoed",
74 | "parkeerplek",
75 | "kookgerei",
76 | "fornuis",
77 | "koffiezet apparaat",
78 | "eetgerei",
79 | "koelkast",
80 | "feun",
81 | "shampoo en conditioner",
82 | "zeep",
83 | "tuin",
84 | "schommel",
85 | "EHBO kit"
86 | ],
87 | description:
88 | "Wat is nou een klassiekere Nederlands verblijfsplaats dan een hutje op de hei? Als je even weg wil van de drukte en belachelijkhe huizenprijzen van de stad is dit een perfecte locatie"
89 | },
90 | {
91 | name: "Vakantievilla Vacuna",
92 | location: "Domburg",
93 | favorite: true,
94 | images: [
95 | "http://www.zeelandrelais.com/files/DSC00204.jpg",
96 | "https://static.ferienhausmiete.de/pictures/106343/bilder_original/106343_1462960274.jpg",
97 | "https://static.ferienhausmiete.de/pictures/106343/bilder_original/106343_1340009402.jpg"
98 | ],
99 | amenities: [
100 | "stofzuiger",
101 | "WiFi",
102 | "droger",
103 | "verwarming",
104 | "TV",
105 | "wieg",
106 | "centrale verwarming",
107 | "beddegoed",
108 | "parkeerplek",
109 | "kookgerei",
110 | "fornuis",
111 | "koffiezet apparaat",
112 | "eetgerei",
113 | "magnetron/oven combinatie",
114 | "koelkast",
115 | "vaatwasser",
116 | "feun",
117 | "shampoo en conditioner",
118 | "wasmachine",
119 | "droger",
120 | "zeep",
121 | "tuin",
122 | "EHBO kit"
123 | ],
124 | description:
125 | "Een rustieke vakantievilla gelegen in Domburg aan de zeeuwse kust. Uitstekende beheersing van de Duitse taal is helaas wel een vereist voor communicatie in de omgeving."
126 | },
127 | {
128 | name: "Appartement voor twee personen",
129 | location: "Utrecht",
130 | favorite: false,
131 | images: [
132 | "http://www.interieur-inrichting.net/afbeeldingen/knus-scandinavisch-appartement-645x484.jpg"
133 | ],
134 | amenities: [
135 | "WiFi",
136 | "droger",
137 | "verwarming",
138 | "TV",
139 | "verduisterende gordijnen",
140 | "centrale verwarming",
141 | "beddegoed",
142 | "kookgerei",
143 | "fornuis",
144 | "koffiezet apparaat",
145 | "eetgerei",
146 | "magnetron/oven combinatie",
147 | "koelkast",
148 | "vaatwasser"
149 | ],
150 | description:
151 | "Een appartement voor twee personen in Utrecht. Ingericht in typische vtwonen stijl. Mooi op het plaatje maar in de realiteit veel te wit."
152 | }
153 | ];
154 |
155 | const getOptions = (path, body, token = undefined) => {
156 | const options = {
157 | url: `http://localhost:3030/${path}`,
158 | headers: { "Content-Type": "application/json" },
159 | method: "POST",
160 | body: JSON.stringify(body)
161 | };
162 | if (token) options.headers["Authorization"] = `Bearer ${token}`;
163 | return options;
164 | };
165 |
166 | const seed = async options => {
167 | await request(options, (err, res) => {
168 | if (err) console.log(err);
169 | if (res && res.statusCode === 200) console.log(`seeded on ${options.url}`);
170 | if (res && res.statusCode !== 200)
171 | console.log(`error: statuscode ${res.statusCode}`);
172 | });
173 | };
174 |
175 | // seed users
176 | const userPromises = users.map(async user => {
177 | const options = getOptions("users", user);
178 | await seed(options);
179 | });
180 |
181 | // wait for all users to be seeded
182 | let token = undefined;
183 | Promise.all(userPromises).then(async () => {
184 | // get auth token for the first user
185 | await request(
186 | getOptions("auth", {
187 | ...users[0]
188 | }),
189 | (_, res) => {
190 | console.log(`got auth token`);
191 | token = JSON.parse(res.body).jwt;
192 | accommodations.map(acc => {
193 | const options = getOptions("accommodations", acc, token);
194 | seed(options);
195 | });
196 | }
197 | );
198 | });
199 |
--------------------------------------------------------------------------------
/cypress/react/.eslintignore:
--------------------------------------------------------------------------------
1 | src/registerServiceWorker.js
--------------------------------------------------------------------------------
/cypress/react/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "airbnb",
3 | "parser": "babel-eslint",
4 | "rules": {
5 | "quotes": "off",
6 | "no-underscore-dangle": "off",
7 | "import/prefer-default-export": 0,
8 | "object-curly-newline": 0,
9 | "react/destructuring-assignment": 0,
10 | "react/prop-types": 0,
11 | "react/jsx-filename-extension": 0,
12 | "react/jsx-one-expression-per-line": 0,
13 | "react/prefer-stateless-function": 0,
14 | "arrow-parens": 0,
15 | "max-len": 0,
16 | "arrow-body-style": 0,
17 | "no-alert": 0,
18 | "prefer-template": 0,
19 | "jsx-a11y/click-events-have-key-events": 0,
20 | "jsx-a11y/no-static-element-interactions": 0,
21 | "operator-linebreak": 0,
22 | "react/no-array-index-key": 0,
23 | "no-console": 0,
24 | "implicit-arrow-linebreak": 0,
25 | "comma-dangle": 0
26 | },
27 | "globals": {
28 | "window": true,
29 | "document": true,
30 | "it": true
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cypress/react/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/cypress/react/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "trailingComma": "es5"
4 | }
5 |
--------------------------------------------------------------------------------
/cypress/react/.vscode/components.code-snippets:
--------------------------------------------------------------------------------
1 | {
2 | "component": {
3 | "prefix": "component",
4 | "body": [
5 | "import * as React from 'react';",
6 | "",
7 | "class ${1:ComponentName} extends React.Component {",
8 | "render(){",
9 | "return
Hello World!
",
10 | "}",
11 | "}",
12 | "",
13 | "export default ${1:ComponentName}"
14 | ]
15 | },
16 | "styledComponent": {
17 | "prefix": "styledComponent",
18 | "body": [
19 | "import * as React from 'react';",
20 | "import withStyles from '@material-ui/core/styles/withStyles';",
21 | "",
22 | "const styles = () => ({ root: {}})",
23 | "",
24 | "class ${1:ComponentName} extends React.Component {",
25 | "render() {",
26 | "return(<>hello world>)",
27 | "}",
28 | "}",
29 | "",
30 | "export default withStyles(styles)(${1:ComponentName})"
31 | ]
32 | },
33 | "connectedComponent": {
34 | "prefix": "connectedComponent",
35 | "body": [
36 | "import * as React from 'react';",
37 | "import { connect } from 'react-redux';",
38 | "",
39 | "class ${1:ComponentName} extends React.Component {",
40 | "render() {",
41 | "return(<>hello world>)",
42 | "}",
43 | "}",
44 | "",
45 | "const mapStateToProps = ({}:{}) => ({})",
46 | "",
47 | "export default connect(mapStateToProps, {})(${1:ComponentName})"
48 | ]
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/cypress/react/cypress.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/cypress/react/cypress/_integration/examples/actions.spec.js:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | context('Actions', () => {
4 | beforeEach(() => {
5 | cy.visit('https://example.cypress.io/commands/actions')
6 | })
7 |
8 | // https://on.cypress.io/interacting-with-elements
9 |
10 | it('.type() - type into a DOM element', () => {
11 | // https://on.cypress.io/type
12 | cy.get('.action-email')
13 | .type('fake@email.com').should('have.value', 'fake@email.com')
14 |
15 | // .type() with special character sequences
16 | .type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
17 | .type('{del}{selectall}{backspace}')
18 |
19 | // .type() with key modifiers
20 | .type('{alt}{option}') //these are equivalent
21 | .type('{ctrl}{control}') //these are equivalent
22 | .type('{meta}{command}{cmd}') //these are equivalent
23 | .type('{shift}')
24 |
25 | // Delay each keypress by 0.1 sec
26 | .type('slow.typing@email.com', { delay: 100 })
27 | .should('have.value', 'slow.typing@email.com')
28 |
29 | cy.get('.action-disabled')
30 | // Ignore error checking prior to type
31 | // like whether the input is visible or disabled
32 | .type('disabled error checking', { force: true })
33 | .should('have.value', 'disabled error checking')
34 | })
35 |
36 | it('.focus() - focus on a DOM element', () => {
37 | // https://on.cypress.io/focus
38 | cy.get('.action-focus').focus()
39 | .should('have.class', 'focus')
40 | .prev().should('have.attr', 'style', 'color: orange;')
41 | })
42 |
43 | it('.blur() - blur off a DOM element', () => {
44 | // https://on.cypress.io/blur
45 | cy.get('.action-blur').type('About to blur').blur()
46 | .should('have.class', 'error')
47 | .prev().should('have.attr', 'style', 'color: red;')
48 | })
49 |
50 | it('.clear() - clears an input or textarea element', () => {
51 | // https://on.cypress.io/clear
52 | cy.get('.action-clear').type('Clear this text')
53 | .should('have.value', 'Clear this text')
54 | .clear()
55 | .should('have.value', '')
56 | })
57 |
58 | it('.submit() - submit a form', () => {
59 | // https://on.cypress.io/submit
60 | cy.get('.action-form')
61 | .find('[type="text"]').type('HALFOFF')
62 | cy.get('.action-form').submit()
63 | .next().should('contain', 'Your form has been submitted!')
64 | })
65 |
66 | it('.click() - click on a DOM element', () => {
67 | // https://on.cypress.io/click
68 | cy.get('.action-btn').click()
69 |
70 | // You can click on 9 specific positions of an element:
71 | // -----------------------------------
72 | // | topLeft top topRight |
73 | // | |
74 | // | |
75 | // | |
76 | // | left center right |
77 | // | |
78 | // | |
79 | // | |
80 | // | bottomLeft bottom bottomRight |
81 | // -----------------------------------
82 |
83 | // clicking in the center of the element is the default
84 | cy.get('#action-canvas').click()
85 |
86 | cy.get('#action-canvas').click('topLeft')
87 | cy.get('#action-canvas').click('top')
88 | cy.get('#action-canvas').click('topRight')
89 | cy.get('#action-canvas').click('left')
90 | cy.get('#action-canvas').click('right')
91 | cy.get('#action-canvas').click('bottomLeft')
92 | cy.get('#action-canvas').click('bottom')
93 | cy.get('#action-canvas').click('bottomRight')
94 |
95 | // .click() accepts an x and y coordinate
96 | // that controls where the click occurs :)
97 |
98 | cy.get('#action-canvas')
99 | .click(80, 75) // click 80px on x coord and 75px on y coord
100 | .click(170, 75)
101 | .click(80, 165)
102 | .click(100, 185)
103 | .click(125, 190)
104 | .click(150, 185)
105 | .click(170, 165)
106 |
107 | // click multiple elements by passing multiple: true
108 | cy.get('.action-labels>.label').click({ multiple: true })
109 |
110 | // Ignore error checking prior to clicking
111 | cy.get('.action-opacity>.btn').click({ force: true })
112 | })
113 |
114 | it('.dblclick() - double click on a DOM element', () => {
115 | // https://on.cypress.io/dblclick
116 |
117 | // Our app has a listener on 'dblclick' event in our 'scripts.js'
118 | // that hides the div and shows an input on double click
119 | cy.get('.action-div').dblclick().should('not.be.visible')
120 | cy.get('.action-input-hidden').should('be.visible')
121 | })
122 |
123 | it('.check() - check a checkbox or radio element', () => {
124 | // https://on.cypress.io/check
125 |
126 | // By default, .check() will check all
127 | // matching checkbox or radio elements in succession, one after another
128 | cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]')
129 | .check().should('be.checked')
130 |
131 | cy.get('.action-radios [type="radio"]').not('[disabled]')
132 | .check().should('be.checked')
133 |
134 | // .check() accepts a value argument
135 | cy.get('.action-radios [type="radio"]')
136 | .check('radio1').should('be.checked')
137 |
138 | // .check() accepts an array of values
139 | cy.get('.action-multiple-checkboxes [type="checkbox"]')
140 | .check(['checkbox1', 'checkbox2']).should('be.checked')
141 |
142 | // Ignore error checking prior to checking
143 | cy.get('.action-checkboxes [disabled]')
144 | .check({ force: true }).should('be.checked')
145 |
146 | cy.get('.action-radios [type="radio"]')
147 | .check('radio3', { force: true }).should('be.checked')
148 | })
149 |
150 | it('.uncheck() - uncheck a checkbox element', () => {
151 | // https://on.cypress.io/uncheck
152 |
153 | // By default, .uncheck() will uncheck all matching
154 | // checkbox elements in succession, one after another
155 | cy.get('.action-check [type="checkbox"]')
156 | .not('[disabled]')
157 | .uncheck().should('not.be.checked')
158 |
159 | // .uncheck() accepts a value argument
160 | cy.get('.action-check [type="checkbox"]')
161 | .check('checkbox1')
162 | .uncheck('checkbox1').should('not.be.checked')
163 |
164 | // .uncheck() accepts an array of values
165 | cy.get('.action-check [type="checkbox"]')
166 | .check(['checkbox1', 'checkbox3'])
167 | .uncheck(['checkbox1', 'checkbox3']).should('not.be.checked')
168 |
169 | // Ignore error checking prior to unchecking
170 | cy.get('.action-check [disabled]')
171 | .uncheck({ force: true }).should('not.be.checked')
172 | })
173 |
174 | it('.select() - select an option in a