Skip to content

Instantly share code, notes, and snippets.

Rafal Fusik rafalf

  • freelancer
  • Dublin
Block or report user

Report or block rafalf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rafalf
rafalf / html_screenshots.py
Created Nov 25, 2018
html webdriver python report screenshots
View html_screenshots.py
@pytest.mark.hookwrapper
def pytest_runtest_makereport(item, call):
"""
Extends the PyTest Plugin to take and embed screenshots in html report, whenever test fails.
:param item:
"""
pytest_html = item.config.pluginmanager.getplugin('html')
outcome = yield
report = outcome.get_result()
extra = getattr(report, 'extra', [])
View gist:970ac1731b922b5f00aeb8e405d8ee36

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@rafalf
rafalf / test_sample.py
Last active Nov 3, 2017
pytest test example for show&tell
View test_sample.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pages.imports import *
from config import BASE_URL, SIGNUP_RETAILER_URL
EAT = "proofing-012@test.com"
INVITE_EMAILS = [
'proofing-020@test.com',
@rafalf
rafalf / conftest.py
Created Nov 3, 2017
pytest conftest for show&tell
View conftest.py
import pytest
from selenium import webdriver
import os
from sys import platform
from config import *
import logging
import logging.config
def pytest_addoption(parser):
@rafalf
rafalf / logger_config.py
Created Oct 6, 2017
Python - Rollover logging with logging config - console & file
View logger_config.py
import logging
from logging import config
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
LOGGING_CONFIG = {
'formatters': {
'brief': {
'format': '[%(asctime)s][%(levelname)s] %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
View pages.js
var bottlejs = require('bottlejs').pop('test');
bottlejs.factory('PageObject', function () {
return {
getTemplatePage: function () {
var templatePage = require('./template.po.js');
return new templatePage();
},
getSearchPage: function () {
var searchPage = require('./search.po.js');
View test.spec.js
var pageObject = require('../../po/pages').container.PageObject;
var templatePage = pageObject.getTemplatePage();
var searchPage = pageObject.getSearchPage();
var slidersPage = pageObject.getSlidersPage();
var detailsPage = pageObject.getDetailsPage();
var loginPage = pageObject.getLoginPage();
var usersData = require('../../data/users/data');
var commonHelper = require('../../helpers/common.helper.js');
describe('Company whitelists', function () {
View googleSheetsMailScrape.py
# http://gspread.readthedocs.io/en/latest/oauth2.html#
# http://alexsavio.github.io/gspread_oauth2client_intro.html
# SHARE with the json email - http://stackoverflow.com/questions/37602460/gspread-exceptions-spreadsheetnotfound
# https://github.com/burnash/gspread
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import time
import requests
from bs4 import BeautifulSoup
View appium-1.4-success-logcat
--------- beginning of main
D/Remote Repository( 3140): Get request : Request{method=GET, url=http://demoapp3v2-env-live.ap-southeast-1.elasticbeanstalk.com/v2/GetUpdatedTableNames?timestamp=1478246849639, tag=null}
D/Remote Repository( 3140): Get response : Response{protocol=http/1.1, code=200, message=OK, url=http://demoapp3v2-env-live.ap-southeast-1.elasticbeanstalk.com/v2/GetUpdatedTableNames?timestamp=1478246849639}
D/Remote Repository( 3140): Get response : com.squareup.okhttp.internal.http.RealResponseBody@2bb133a5
E/PushPull Helper( 3140): Response received, parsing.. {"success":true,"ErrorCode":100,"message":"completed sucessfully","items":[],"ServerCurrentTime":1478246923362,"recordCount":0}
View gist:23c02967b1e3dafcc428f27d0375d63d
--------- beginning of main
I/CoreCoach( 2707): Synch completed
I/CoreCoach( 2707): Synch is in progress....
I/CoreCoach( 2707): Last Synch time .. 1478245821615
W/PushPull Helper( 2707): get updated tables : 1478245821615
You can’t perform that action at this time.