Skip to content

Instantly share code, notes, and snippets.

View gunesmes's full-sized avatar
🎯
Focusing

Mesut Güneş gunesmes

🎯
Focusing
View GitHub Profile
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
version: '3'
services:
influxdb:
build:
context: .
dockerfile: Dockerfile.influxdb
ports:
- "8086:8086"
grafana:
build:
@gunesmes
gunesmes / getText.kt
Created December 6, 2019 08:29
gettint text of ViewInteraction element in espresso
fun getText(matcher: ViewInteraction): String {
var text = String()
matcher.perform(object : ViewAction {
override fun getConstraints(): Matcher<View> {
return isAssignableFrom(TextView::class.java)
}
override fun getDescription(): String {
return "Text of the view"
}
public static String getDefaultSharedPreferencesName(Context context) {
return context.getPackageName() + "_preferences";
}
// If you need to RSA Ecryption for secure process, postman doesn't have embed library to use
// however you use pre-request script to encrpt your data over external services and create a environment variable
// this is an example for using https://8gwifi.org, better to use internal services.
var myData = {"name": "TestName","birthday": 03,"birthMonth": 09, "secret": "topSecretPassword"}
var encodedMyData = encodeURIComponent(JSON.stringify(myData));
var encodedPublicKey = encodeURIComponent(pm.environment.get("puclic-key"));
var bodyEncodedMyData = `methodName=CALCULATE_RSA&encryptdecryptparameter=encrypt&publickeyparam=-----BEGIN+PUBLIC+KEY-----%0D%0A${encodedPublicKey}%0D%0A-----END+PUBLIC+KEY-----%0D%0A&privatekeyparam=&message=${encodedMyData}&cipherparameter=RSA`;
// payment/payment-processing > test section
// payment processing request calls itself until the response is `processing`
// when get other response it should call the `payment/payment-complete` as `setNextRequest`
var jsonData = pm.response.json();
if (jsonData.status == "processing"){
// wait 1 second and re-try until the response status is successful
setTimeout(function(){}, 1000);
postman.setNextRequest("payment/payment-processing");
FROM node:6.5.0-slim
RUN npm install newman
RUN npm install newman-reporter-html
RUN mkdir /newman
WORKDIR /newman
ENTRYPOINT ["/node_modules/.bin/newman"]
@gunesmes
gunesmes / calabash-x-platform-converter.sh
Last active October 5, 2018 13:19
convert calabash x-platform to generic calabash-android and calabash-ios project
#!/bin/bash
echo -e "\nConverting X-platform to generic Calabash folder"
FILE_PATH=$PWD
GENERIC_PATH=$PWD/../calabash-generic
if [[ -d $FILE_PATH/calabash-generic ]]; then
rm -rf $FILE_PATH/calabash-generic
fi
@gunesmes
gunesmes / capybara_dockerfile
Last active February 22, 2019 14:40
Docker helps you to run your test isolated. If you are using Capybara with Cucumber, tagging is a very efficient feature of the Cucumber for manageable test cases. Tagging can be also used for managing test environment, like @test may mean that these tests run only in the test environment so set the environment as the test for me. Likely @LiVe m…
FROM ruby:2.3
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
# Set timezone
RUN echo "US/Eastern" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
RUN apt-get update -y && \
apt-get install -y unzip xvfb \
@gunesmes
gunesmes / Dockerfile
Last active September 4, 2023 00:03
Run Locust in Dockers for performance testing.
FROM python:alpine3.7
RUN apk -U add ca-certificates python python-dev py-pip build-base && \
pip install --upgrade pip && \
pip install locustio pyzmq && \
apk del python-dev && \
rm -r /var/cache/apk/* && \
mkdir /locust
WORKDIR /locust