Skip to content

Instantly share code, notes, and snippets.

View adnanrahic's full-sized avatar
🥑
Channeling my inner Avocado at @kubeshop

Adnan Rahić adnanrahic

🥑
Channeling my inner Avocado at @kubeshop
View GitHub Profile
import { test, expect } from "@playwright/test";
import Tracetest, { Types } from "@tracetest/playwright";
const { TRACETEST_API_TOKEN = "" } = process.env;
let tracetest: Types.TracetestPlaywright | undefined = undefined;
test.describe.configure({ mode: "serial" });
const definition = `
type: Test
version: "3"
services:
# Tracetest
tracetest:
image: kubeshop/tracetest
volumes:
- ./tracetest.config.yaml:/app/tracetest.yaml
- ./tracetest.provision.yaml:/app/provisioning.yaml
ports:
type: Test
spec:
id: W656Q0c4g
name: http://app:8080
description: akadlkasjdf
trigger:
type: http
httpRequest:
url: http://app:8080
method: GET
- selector: span[tracetest.span.type="database" name="create pokeshop.pokemon" db.system="postgres"
db.name="pokeshop" db.user="ashketchum" db.operation="create" db.sql.table="pokemon"]
assertions:
- attr:db.result | json_path '$.name' = env:IMPORTED_POKEMON_NAME
outputs:
- name: POKEMON_DB_ID
selector: span[tracetest.span.type="database" name="create pokeshop.pokemon" db.system="postgres"
db.name="pokeshop" db.user="ashketchum" db.operation="create" db.sql.table="pokemon"]
value: attr:db.result | json_path '$.id'
attr:http.response.body | json_path '$.name'
url: ${env:HTTP_HOST}/pokemon/import
${env:variablename}
type: Test
spec:
id: 6T0F1LOVR
name: OSCAR - DEMO - Import
description: Import a Pokemon
trigger:
type: http
httpRequest:
url: ${env:HTTP_HOST}/pokemon/import
method: POST
# k8s ingress
# Deployments
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webapp1
spec:
replicas: 1