This file contains 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
Feature('Lottery test'); | |
Scenario('test stickers distribution', async (I) => { | |
const letters = ["0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; | |
I.amOnPage("https://www.somecashbacksite.co.uk/search/merchants/?letter=A"); | |
I.wait(180); // Have a time to log in and do Captcha manually | |
// Infinetely wander through website | |
while(true) { | |
// Go through letters | |
for (let currentLetter = 0; currentLetter < letters.length; currentLetter++) { |
This file contains 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
pm.test("Response time is less than 300ms", function () { | |
pm.expect(pm.response.responseTime).to.be.below(300); | |
}); |
This file contains 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 vision = require("@google-cloud/vision"); | |
const fileName = "./screenshots/google.png"; | |
const client = new vision.ImageAnnotatorClient(); | |
(async function save() { | |
const [result] = await client.safeSearchDetection(fileName); | |
const detections = result.safeSearchAnnotation; | |
console.log(`Adult: ${detections.adult}`); | |
console.log(`Medical: ${detections.medical}`); |
This file contains 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 translate = new Translate(); | |
const text = ["这是一个非常好的API", "to jest bardzo dobre API"]; | |
async function detectLanguage() { | |
let [detections] = await translate.detect(text); | |
detections = Array.isArray(detections) ? detections : [detections]; | |
console.log("Detections:"); | |
detections.forEach((detection) => { | |
console.log(detection); |
This file contains 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
async function listLanguages() { | |
const [languages] = await translate.getLanguages(); | |
console.log("Languages:"); | |
languages.forEach((language) => console.log(language)); | |
} | |
listLanguages(); |
This file contains 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 text = [ | |
"这是一个非常好的API", | |
"to jest bardzo dobre API", | |
"это очень хороший API", | |
]; | |
const target = "en"; | |
async function translateText() { | |
let [translations] = await translate.translate(text, target); | |
translations = Array.isArray(translations) ? translations : [translations]; |