This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| var http = require('http') | |
| var request = require('request') | |
| var gm = require('gm') | |
| var fs = require('fs') | |
| var FormData = require('form-data') | |
| let r1 = request('https://upload.wikimedia.org/wikipedia/commons/e/eb/Ash_Tree_-_geograph.org.uk_-_590710.jpg') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @see https://strongloop.com/strongblog/modular-node-js-express/ | |
| var fs = require('fs') | |
| var resolve = require('path').resolve | |
| var join = require('path').join | |
| var cp = require('child_process') | |
| // get library path | |
| var src = resolve(__dirname, '../src/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer') | |
| const express = require('express') | |
| const querystring = require('querystring') | |
| const server = express() | |
| /** | |
| * Screenshot a url | |
| * e.g. /screenshot?url=https://www.npmjs.com&width=800&height=600 | |
| */ | |
| server.get('/screenshot', async (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This test ensures there is no render gap between when a page is published and made available. | |
| // Specifically we expect to get a 200 response (vs 404) immediately, within milliseconds, after a page is published. | |
| // We will prove this by making a request to site-engine every X milliseconds and then triggering a publish | |
| // At no time should we recieve a 404 response | |
| const ZESTY_INSTANCE_DOMAIN = "http://zesty.pw/"; | |
| const ZESTY_USER_EMAIL = ""; | |
| const ZESTY_USER_PASSWORD = ""; | |
| const ZESTY_INSTANCE_ZUID = "8-f48cf3a682-7fthvk"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Generates requests in batches over a specified time period | |
| * By varying the batch size randomly up to a max, it simulates more natural traffic | |
| * @name genRequests | |
| * @param {String} url The URL to send requests to | |
| * @param {Number} total Total number of requests to send | |
| * @param {Number} batchMax Max number of requests to send in parallel per batch | |
| * @param {Number} runTime Amount of time in millseconds to spread the requests over | |
| * @returns {Promise<Number>} Number of requests completed | |
| */ |
OlderNewer