@flood/chrome
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@flood/chrome", | ||
"version": "0.1.0", | ||
"private": false, | ||
"description": "Flood Chrome provides an API for scripting Browser Level Load Tests", | ||
"types": "./index.d.ts", | ||
"scripts": { | ||
"build:live": "nodemon --exec ts-node -- ./index.ts", | ||
"test": "lab --sourcemaps --transform node_modules/lab-transform-typescript ./tests", | ||
"test:ci": "lab --transform node_modules/lab-transform-typescript ./tests", | ||
"test:live": "nodemon --ext ts --watch ./tests --watch ./src --exec 'npm test'" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/flood-io/browser-test.git" | ||
}, | ||
"author": "Ivan Vanderbyl", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/flood-io/browser-test/issues" | ||
}, | ||
"homepage": "https://github.com/flood-io/browser-test#readme", | ||
"dependencies": { | ||
"typescript": "^2.6.1" | ||
}, | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"devDependencies": {}, | ||
"keywords": [ | ||
"load-testing", | ||
"browser-testing", | ||
"bdd", | ||
"tdd", | ||
"performance" | ||
] | ||
"name": "@flood/chrome", | ||
"version": "0.1.1", | ||
"private": false, | ||
"description": "Flood Chrome provides an API for scripting Browser Level Load Tests", | ||
"types": "./index.d.ts", | ||
"scripts": { | ||
"release": "npm-release" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/flood-io/browser-test.git" | ||
}, | ||
"author": "Ivan Vanderbyl", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/flood-io/browser-test/issues" | ||
}, | ||
"homepage": "https://github.com/flood-io/browser-test#readme", | ||
"dependencies": { | ||
"typescript": "^2.6.1" | ||
}, | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"files": [ | ||
"README.md" | ||
], | ||
"devDependencies": { | ||
"npm-release": "^1.0.0" | ||
}, | ||
"keywords": [ | ||
"load-testing", | ||
"browser-testing", | ||
"bdd", | ||
"tdd", | ||
"performance" | ||
] | ||
} |
@@ -1,28 +0,56 @@ | ||
# Browser Level Load Testing | ||
# Browser Level Load Testing with Flood | ||
This project provides a WebDriver.js / Selenium compatible DSL for creating Browser Load Test scripts which will run in the Flood Chrome test environment. | ||
> Flood Chrome brings the familiar power of traditional browser scripting tools with the proven performance of Flood to create an easy to use and maintainable performance testing tool. | ||
## Example | ||
This package provides the type definitions to help you write Flood Chrome "BLU" scripts and run them on Flood using real browsers. | ||
Example for completing the first 2 steps of the Flood Challenge. | ||
# Get Started | ||
(Script in ES6 format) | ||
**1. Create a Workspace** | ||
```js | ||
import { test, step, By } from "@flood-io/browser-test" | ||
Create a new project directory or skip to step 2 if you're using an existing project | ||
**2. Install `@flood/chrome`** | ||
Add `@flood/chrome` as a development dependency to your `package.json`: | ||
```bash | ||
# using yarn | ||
yarn add @flood/chrome | ||
# using NPM | ||
npm install -sd @flood/chrome | ||
``` | ||
**3. Create test script** | ||
Flood Chrome uses TypeScript for type correctness and inline documentation as you write. Make sure you have TypeScript support enabled in your editor. | ||
```ts | ||
// 1. Import the basic test components from this package | ||
import { test, step, assert } from '@flood/chrome' | ||
// 2. Define the test. Every test must make this call to register itself | ||
test(() => { | ||
step("Start", (driver) => { | ||
driver.goto("https://challenge.flood.io") | ||
driver.screenshot() | ||
let startButton = driver.findElement(By.css("#new_challenger > input.btn.btn-xl.btn-default"))startButton.click() | ||
/** | ||
* 3. Define your first step. | ||
* | ||
* Each step must have a unique label as the first argument, and an async callback function | ||
* as the second argument. The callback function receives an instance of the Driver, which | ||
* exposes all the functions you can call on Browser during a test. | ||
* | ||
* Using async/await is simply a cleaner way of using Promises, and allows us to keep the test plan | ||
* very clean and succinct without declaring multiple Promise chain callbacks. | ||
*/ | ||
step('1. Start challenge', async (driver: Driver) => { | ||
await driver.visit('https://challenge.flood.io') | ||
let h2 = await driver.waitForElement('h2') | ||
let h2Text = await driver.extractText(h2) | ||
assert.equal(h2Text, 'Flood Challenge') | ||
}) | ||
step("Step 2", (driver) => { | ||
driver.findElement(By.css("#challenger_age")).selectByText("28") | ||
driver.findElement(By.css("input.btn")).click() | ||
}) | ||
}) | ||
``` | ||
> Notice that you don't need to use async or Promises, we automatically handle them for you, | ||
> however you can use them for syntactic sugar if you need. | ||
**4. Upload to Flood** | ||
Once you've written your first script, simply [upload it to Flood](https://flood.io/app) and launch a test. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56
14099
1
3
0
2