Skip to content

Instantly share code, notes, and snippets.

@testautomation
testautomation / RESTInstance_JSON_string_contains.robot
Created March 5, 2020 13:56
RESTInstance example - JSON Schema keyword `pattern` for testing if a JSON string contains something
*** Settings ***
Library REST
*** Test Cases ***
Use JSON Schema keyword pattern to test JSON string for substrings
[Setup] GET https://jsonplaceholder.typicode.com/users/1
# matches "Leanne Graham" as a substring:
String response body name pattern="anne Grah"
@testautomation
testautomation / case_switch.py
Created February 16, 2020 19:06
How Can We Best Switch in Python?
# BLOG: https://medium.com/swlh/how-can-we-best-switch-in-python-458fb33f7835
def explain_char(character):
"""
switch using if / elif / else
"""
something = ''
if character == 'a':
something = 'first letter of alphabet'
@testautomation
testautomation / circleci-conditional-job.md
Last active December 3, 2021 15:41
CircleCi - conditional jobs would make every body happy

simlified .circleci/config.yml

workflows:

  parallel-robot-tests:

      jobs:
        - build-artifacts:
 - test-suit-1:
@testautomation
testautomation / Dockerfile
Last active December 3, 2021 15:49
Java Spring Boot Application + Docker - cache generation issue. Related source code: https://github.com/ehrbase/ehrbase
# postgres db container with some ehrbase customizations
FROM ehrbaseorg/ehrbase-database-docker:11.5
# you may need to adjust the IP address
ENV DB_URL="jdbc:postgresql://172.17.0.2:5432/ehrbase"
ENV DB_USER="postgres"
ENV DB_PASS="postgres"
ENV POSTGRES_USER="postgres"
ENV POSTGRES_PASSWORD="postgres"
@testautomation
testautomation / xml-elements-should-match-vs-should-be-equal.md
Created October 29, 2019 12:52
XML - Elements Should Match vs. Elements Should Be Equal (Robot Framework / #robotframework)
*** Settings ***
Library    XML



*** Test Cases ***
XML Elements Should Match
    ${a}                Parse Xml  <units>mm[Hg]</units>
 ${b} Parse Xml mm[Hg]