Skip to content

Commit

Permalink
update chapter 12
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Mar 31, 2024
1 parent fe7916d commit b20cc58
Show file tree
Hide file tree
Showing 20 changed files with 275 additions and 288 deletions.
2 changes: 1 addition & 1 deletion solutions/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Solutions
=========

If you get stuck in one of the chapters you can look in here to see how it was suppose to be done. Every solution for each chapter has a different NPM `package.json` so ensure that you install the dependency before you run the example.
If you get stuck in one of the chapters you can look in here to see how it was supposed to be done. Every solution for each chapter has a different NPM `package.json` so ensure that you install the dependency before you run the example.
8 changes: 4 additions & 4 deletions solutions/chapter_02/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "chapter2",
"version": "1.0.0",
"description": "",
"description": "Chapter 2 of the WebdriverIO workshop: Writing an automation script using Standalone Mode",
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"type": "module",
"scripts": {
"test": "node test.js"
},
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"devDependencies": {
"webdriverio": "^8.32.4"
}
Expand Down
8 changes: 4 additions & 4 deletions solutions/chapter_03/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "chapter3",
"version": "1.0.0",
"description": "",
"description": "Chapter 4 of the WebdriverIO workshop: WDIO Testrunner",
"type": "module",
"scripts": {
"test": "wdio wdio.conf.js"
},
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"scripts": {
"test": "wdio wdio.conf.js"
},
"devDependencies": {
"@wdio/cli": "^8.32.4",
"@wdio/local-runner": "^8.32.4",
Expand Down
8 changes: 4 additions & 4 deletions solutions/chapter_04/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "chapter4",
"version": "1.0.0",
"description": "",
"description": "Chapter 4 of the WebdriverIO workshop: Use of Reporter and Services",
"type": "module",
"scripts": {
"test": "wdio wdio.conf.js"
},
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"scripts": {
"test": "wdio wdio.conf.js"
},
"devDependencies": {
"@wdio/allure-reporter": "^8.32.4",
"@wdio/cli": "^8.32.4",
Expand Down
8 changes: 4 additions & 4 deletions solutions/chapter_05/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "chapter5",
"version": "1.0.0",
"description": "",
"description": "Chapter 5 of the WebdriverIO workshop: Performance Testing",
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"type": "module",
"scripts": {
"test": "wdio wdio.conf.js",
"test:sauce": "wdio wdio.sauce.conf.js"
},
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"devDependencies": {
"@wdio/allure-reporter": "^8.32.4",
"@wdio/cli": "^8.32.4",
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_05/wdio.sauce.conf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import url from 'node:url'
import path from 'node:path'
import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

const __dirname = path.resolve(url.fileURLToPath(new URL('.', import.meta.url)))

export const config = {
...baseConfig,
...sharedConfig,
services: [],
specs: [
__dirname + '/test/specs/extra.js'
Expand Down
2 changes: 1 addition & 1 deletion solutions/chapter_06/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "chapter5",
"name": "chapter6",
"version": "1.0.0",
"description": "Chapter 6 of the WebdriverIO workshop: PWA Testing",
"keywords": [],
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_09/perfecto/wdio.local.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import allure from 'allure-commandline'

import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

export const config = {
...baseConfig,
...sharedConfig,

capabilities: [{
maxInstances: 5,
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_09/perfecto/wdio.perfecto.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

const perfectoOptions = {
'perfecto:options': {
Expand All @@ -7,7 +7,7 @@ const perfectoOptions = {
}

export const config = {
...baseConfig,
...sharedConfig,

/**
* Perfecto connection details
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_09/saucelabs/wdio.local.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import allure from 'allure-commandline'

import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

export const config = {
...baseConfig,
...sharedConfig,

capabilities: [{
maxInstances: 5,
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_09/saucelabs/wdio.sauce.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

const sauceOptions = {
'sauce:options': {
Expand All @@ -7,7 +7,7 @@ const sauceOptions = {
}

export const config = {
...baseConfig,
...sharedConfig,

/**
* Sauce Labs Credentials
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_10/wdio.local.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import allure from 'allure-commandline'

import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

export const config = {
...baseConfig,
...sharedConfig,

capabilities: [{
maxInstances: 5,
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_11/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chapter9",
"name": "chapter11",
"version": "1.0.0",
"description": "Chapter 10 of the WebdriverIO workshop: Visual Regression Testing",
"description": "Chapter 11 of the WebdriverIO workshop: Visual Regression Testing",
"main": "index.js",
"keywords": [],
"author": "Christian Bromann <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions solutions/chapter_11/wdio.applitools.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import allure from 'allure-commandline'

import { config as baseConfig } from './wdio.conf.js'
import { config as sharedConfig } from './wdio.conf.js'

export const config = {
...baseConfig,
...sharedConfig,

capabilities: [{
maxInstances: 5,
Expand Down
25 changes: 11 additions & 14 deletions solutions/chapter_12/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
{
"name": "chapter9",
"name": "chapter12",
"version": "1.0.0",
"description": "",
"main": "index.js",
"description": "Chapter 12 of the WebdriverIO workshop: TypeScript",
"scripts": {
"test": "wdio wdio.local.conf.ts"
},
"keywords": [],
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"devDependencies": {
"@wdio/allure-reporter": "^7.20.3",
"@wdio/cli": "^7.20.4",
"@wdio/local-runner": "^7.20.4",
"@wdio/mocha-framework": "^7.20.3",
"@wdio/spec-reporter": "^7.20.3",
"allure-commandline": "^2.17.2",
"chromedriver": "^103.0.0",
"ts-node": "^10.8.1",
"typescript": "^4.7.4",
"wdio-chromedriver-service": "^7.3.2",
"webdriverio": "^7.20.4"
"@wdio/allure-reporter": "^8.34.0",
"@wdio/cli": "^8.35.1",
"@wdio/local-runner": "^8.35.1",
"@wdio/mocha-framework": "^8.35.0",
"@wdio/spec-reporter": "^8.32.4",
"allure-commandline": "^2.27.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.3",
"webdriverio": "^8.35.1"
}
}
4 changes: 2 additions & 2 deletions solutions/chapter_12/test/pageobjects/main.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import TodoEntry from './todo.entry'

class TodoAppPO {
export class TodoAppPageObject {
get newTodoInput () {
return $('.new-todo')
}
Expand Down Expand Up @@ -37,4 +37,4 @@ class TodoAppPO {
}
}

export const TodoApp = new TodoAppPO()
export const TodoApp = new TodoAppPageObject()
2 changes: 1 addition & 1 deletion solutions/chapter_12/test/specs/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { TodoApp } = require('../pageobjects/main.page')
import { TodoApp } from '../pageobjects/main.page.js'

describe('My Vue.js Example Application', () => {
it('should be able to complete ToDos', async () => {
Expand Down
13 changes: 8 additions & 5 deletions solutions/chapter_12/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
Expand Down Expand Up @@ -49,10 +49,13 @@
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": [
"node", "webdriverio/async", "@wdio/mocha-framework", "expect-webdriverio"
"node",
"@wdio/globals/types",
"@wdio/mocha-framework",
"expect-webdriverio"
], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */

Expand All @@ -67,7 +70,7 @@
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */

/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
// "skipLibCheck": false, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
Loading

0 comments on commit b20cc58

Please sign in to comment.