Skip to content

Instantly share code, notes, and snippets.

View MarcusFelling's full-sized avatar

Marcus Felling MarcusFelling

View GitHub Profile
// The following will create an Azure Function app on
// a consumption plan, along with a storage account
// and application insights.
param location string = resourceGroup().location
param appNamePrefix string = uniqueString(resourceGroup().id)
param workspaceResourceId string
var functionAppName = '${appNamePrefix}-functionapp'
@MarcusFelling
MarcusFelling / hdi-nsg-with-vnet.bicep
Last active May 17, 2021 14:17
hdi-nsg-with-vnet.bicep
param location string = resourceGroup().location
param clusteruser string = 'clusteradmin'
param sshuser string = 'sshadmin'
@secure()
param clusterpassword string = 'ChangeMe12345'
@secure()
param sshpassword string = '12345ChangeMe'
resource storage 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: 'storhdi${uniqueString(resourceGroup().id)}'
@minLength(1)
@maxLength(11)
param projectName string = 'demo'
param location string = resourceGroup().location
var unique = uniqueString(resourceGroup().id)
var iotHubName = '${projectName}Hub${unique}'
var storageAccountName = '${toLower(projectName)}${unique}'
var storageEndpoint = '${projectName}StorageEndpoint'
// Change scope to create resource group
targetScope = 'subscription'
// Create resource Group
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'myIoTProjectRG'
location: 'eastus'
}
// Create IoT project inside resource group above
const { test, expect } = require('@playwright/test');
test('test', async ({ page }) => {
// Go to https://nunzioweb.com/iframes-example.htm
await page.goto('https://nunzioweb.com/iframes-example.htm');
// Click img[alt="Killer Klowns From Outer Space"]
await page.frame({
url: 'https://nunzioweb.com/001-opacity-example.htm'
name: Demo.Playwright
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: "Test site using Playwright"
timeout-minutes: 60
- name: Publish HTML report to testresults.marcusfelling.com
if: always() # We want this to always run, even if test fail prior to this step running
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: playwright-report/ # This is where index.html will be output
keep_files: true # Set this to true to make sure we don't wipe out the other content in GitHub Pages
user_name: 'github-actions[bot]' # This will be the username that gets stamped in the repo commit
user_email: 'github-actions[bot]@users.noreply.github.com' # This will be the user email that gets stamped in the repo commit
test:
name: "Test site using Playwright"
runs-on: ubuntu-20.04
container: mcr.microsoft.com/playwright:focal
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install dependencies
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
import { chromium, FullConfig } from '@playwright/test';
async function globalSetup(config: FullConfig) {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto(process.env.BASEURL);
// Sign in using creds from env variables
await page.getByTitle('Sign In').click();
await page.getByPlaceholder("Email\\, phone\\, or Skype").fill(process.env.AADUSERNAME);
await page.getByPlaceholder("Email\\, phone\\, or Skype").press('Enter');