Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flood/chrome

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flood/chrome - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

74

package.json
{
"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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc