Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#
# Corey Goldberg, Dec 2012
# Dmytro Makhno, Mar 2015
#
import os
import sys
import xml.etree.ElementTree as ET
@dmakhno
dmakhno / correct.out
Created March 15, 2013 17:54
Broken ScalaTest Stream
[info] parallel1Test:
[info] for Config1
[info] - Phase 1 (1 second, 191 milliseconds)
[info] - Phase 2 (1 second, 5 milliseconds)
[info] parallel19Test:
[info] for Config19
[info] - Phase 1 (1 second, 190 milliseconds)
[info] - Phase 2 (1 second, 7 milliseconds)
[info] parallel20Test:
[info] for Config20
@dmakhno
dmakhno / parallel.scala
Last active December 14, 2015 04:39
dynamic parallel ScalaTest
class SequentialTest(alias:String) extends FreeSpec with CancelAfterFailure {
"for %s".format(alias) - {
"Phase 1" in {
for (j <- 0 until 10) {
println("%s: working %s Phase-1 %s".format(new DateTime(),alias,j))
Thread.sleep(100)
}
}
"Phase 2" in {
for (j <- 0 until 10) {
@dmakhno
dmakhno / python.py
Created July 21, 2014 08:47 — forked from DmZ/python.py
#!/usr/bin/env python
# Copyright Jon Berg , turtlemeat.com
# Modified by nikomu @ code.google.com
# Updated for Python 2.4 (dmitry.zamaruev@gmail.com)
# Usage example:
# start server in required directory: python serve.py
# upload file to server: curl -F "upfile=@some.file.pdf" http://127.0.0.1:8080/
@dmakhno
dmakhno / run_log
Last active August 29, 2015 13:58
Paralleling tests
$ nosetests --processes 5 test_debug_parallel.py
INFO - heavy operation is beginning... 1 FirstTest
INFO - heavy operation is beginning... 1 SecondTest
INFO - heavy operation is beginning... 1 ThirdTest
INFO - heavy operation has ended 1 FirstTest
DEBUG - 47620 140735328031504 1396607234.95 setUpClass 1 FirstTest
INFO - heavy operation has ended 1 SecondTest
DEBUG - 47621 140735328031504 1396607234.96 setUpClass 1 SecondTest
INFO - heavy operation has ended 1 ThirdTest
DEBUG - 47622 140735328031504 1396607234.98 setUpClass 1 ThirdTest

You need:

Define module constuructor in init.py

import os
from selenium_utils.page import PageBuilder

from selenium_utils import read_utils_config
from selenium_utils.screenshot import WebScreenShotUtil
from selenium_utils.splinter_wrapper import SplinterDriver, SplinterFactory