Sha256: a031bab7577d9dc16439b18bcd6439f2e893e23bfbdd67339c928ba4dd3615bc

Contents?: true

Size: 1.28 KB

Versions: 18

Compression:

Stored size: 1.28 KB

Contents

const puppeteer = require('puppeteer');
const fs = require('fs');
const sha1File = require('sha1-file');
require('dotenv').config();

if (!fs.existsSync('./public/assets/screenshots')){
  fs.mkdirSync('./public/assets/screenshots');
}

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({ width: 800, height: 500 })
  await page.goto('https://dashboard.nexmo.com/sign-in');

  await page.waitForSelector('input[name=username]')
  await page.type('input[name=username]', process.env.NEXMO_USERNAME)
  await page.type('input[name=password]', process.env.NEXMO_PASSWORD)
  await page.click('#btn_login')

  await page.waitForSelector('#nav-expander')
  await page.goto('https://dashboard.nexmo.com/settings');

  await page.waitForSelector('#nav-expander')
  await page.click('#httpBaseUrlForDnPost')

  await page.addStyleTag({
    content: `
      #sysId, #password, #signatureSecret {
        filter: blur(5px);
      }
    `
  })

  await page.screenshot({ path: 'public/assets/screenshots/tmp.png' })

  const sha = sha1File('public/assets/screenshots/tmp.png')
  const newPath = `public/assets/screenshots/${sha}.png`
  fs.renameSync('public/assets/screenshots/tmp.png', newPath)

  await browser.close();

  console.log(newPath);
})();

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
station-0.0.113 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.112 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.111 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.110 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.109 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.108 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.107 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.106 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.105 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.104 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.103 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.102 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.101 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.100 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.97 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.96 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.95 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js
station-0.0.93 lib/nexmo_developer/app/screenshots/webhook-url-for-delivery-receipt.js