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
# Powershell | |
docker cp "$(docker ps -qf 'name=<name of container>'):/app/test-reports/report-1.html" "./report-1.html" | |
# Gitlab Pipeline Job | |
copy_artifact: | |
stage: artifacts | |
script: | |
- docker cp $(docker ps -qf "name=<name of container>"):/app/test-reports/report-1.html ./report-1.html | |
artifacts: |
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
If web app uses AWS RDS for database, then the following can be done: | |
- AWS Lambda function executes DB queries directed to RDS | |
- Trigger of Lambda function -> AWS API Gateway (RestAPI) | |
- Test suite can trigger REST API call on start |
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
// See also https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditions | |
import { test, chromium } from '@playwright/test'; | |
test("throttle network speed to 2.1 Mbps", async ({ }) => { | |
const browser = await chromium.launchPersistentContext(""); | |
const page = await browser.newPage(); | |
const client = await page.context().newCDPSession(page); | |
await client.send("Network.enable"); | |
await client.send("Network.emulateNetworkConditions", { |
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
for /f "delims=" %%a in ('wmic OS get localdatetime ^| find "."') do set datetime=%%a | |
set "YYYY=%datetime:~0,4%" | |
set "MM=%datetime:~4,2%" | |
set "DD=%datetime:~6,2%" | |
set "HH=%datetime:~8,2%" | |
set "MI=%datetime:~10,2%" | |
set "SS=%datetime:~12,2%" | |
set fullstamp=%YYYY%-%MM%-%DD%-%HH%-%MI%-%SS% |
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
private function extract_all_page_links( AcceptanceTester $I ): array { | |
$I->amOnPage( '/example/' ); | |
$url = $this->base_url . 'example/'; | |
$aLinks = $I->grabMultiple( "//a[contains(@href,'{$url}' )]", 'href' ); | |
return array_unique( $aLinks ); | |
} |
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
$ sudo apt-get -y update | |
$ sudo apt-get -y install ruby | |
$ echo 'export PATH="$PATH:$HOME/bin"/' >> ~/.bashrc | |
$ sudo touch /bin/allgood && sudo chmod 755 /bin/allgood | |
$ sudo nano /bin/allgood | |
# Then add this into the "allgood" file | |
-------------------------------------------- | |
#!/usr/bin/env ruby |
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
sudo apt-get -y install python3-pip | |
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
unzip awscli-bundle.zip | |
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws | |
aws --version |
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
echo "alias aliasname='command'" >> ~/.bash_aliases && source ~/.bash_aliases |
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
@ECHO OFF | |
TITLE=Update Hosts File | |
set /p ip_address="Enter ip adress: " | |
set /p domain="Enter domain: " | |
copy C:\Windows\System32\drivers\etc\hosts C:\Windows\System32\drivers\etc\hosts.bck | |
ECHO. >> C:\Windows\System32\drivers\etc\hosts | |
ECHO %ip_address% %domain% >> C:\Windows\System32\drivers\etc\hosts | |
PAUSE |
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
# Create a Ubuntu Server 18.04 LTS instance | |
# Associate an Elastic IP to instance - https://docs.bitnami.com/aws/faq/configuration/configure-static-address/ | |
# Add inbound security group rule.. | |
# Custom TCP TCP 8080 0.0.0.0/0 | |
# Install Java and Docker | |
sudo apt update | |
sudo apt install -y openjdk-8-jdk | |
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |