Skip to content

Instantly share code, notes, and snippets.

View BeyondEvil's full-sized avatar

Jim Brännlund BeyondEvil

  • Proxy.com
  • Sweden
View GitHub Profile
#first
if browser.lower() == 'firefox':
driver = webdriver.Firefox
self._kwargs.update({'browser_profile' if self._use_grid else 'firefox_profile': firefox_profile()})
desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
#later
if self._use_grid:
host = get_config().getini("grid_host")
port = get_config().getini("grid_port")
@pytest.fixture(scope='module', autouse=True)
def test_db(request):
"""
Creates a TestDataCollection instance which houses all the data representation objects.
:param request: py.test request module
:return: TestDataCollection instance
"""
from test_automation.representations.test_data_collection import TestDataCollection
def pytest_runtest_setup(item):
"""
py.test hook for test configuration
:param item: py.test item module
:return: None
"""
from tools import TagsCollection
print "IN RUNTEST"
print item
def test_move_multiple_card_via_shiftselect(self, test_db, bunch_of_cards):
expected_swimlane_category = "None"
page = BoardPage(self.test_driver, test_db)
page.go_to_page(test_db.get_default('User').identifier, DoPlan.PRO_PROJECT, DoPlan.PRO_BOARD)
list_of_cards = GenericCard.get_name_list(DoPlan.PRO_PROJECT, [1, 2, 3, 4, 5])
actual_swimlane_category = page.toggle_swimlanes(expected_swimlane_category)
Validation.assert_equal(expected_swimlane_category, actual_swimlane_category,
"Swimlanes aren't grouped by expected category <{}>!".format(
expected_swimlane_category))
page = page.shift_select_cards(list_of_cards[0], list_of_cards[4]) # returnera CardDetailsPane(self.test_driver, test_db)
@pytest.fixture(scope='module', autouse=True)
def init_test_db(request):
"""
Creates a TestDataCollection instance which houses all the data representation objects.
:param request: py.test request module
:return: TestDataCollection instance
"""
tdc = TestDataCollection()
request.module.tdc = tdc
import pytest
from tools import TestDataCollection
from representations import Project
@pytest.fixture(scope='function')
def test_driver(request, selenium):
from test_automation.tools.test_driver import TestDriver
return TestDriver(selenium)
@pytest.fixture()
def user(request):
user_name = request.param.get('name')
//do something
@pytest.fixture()
def account(request):
account_name = request.param.get('name')
import pytest
from test_automation_representations import TestData
def test_something():
// do some testing
/*
Mutation Observer object
Used to detect and inspect changes to the DOM
See:
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
*/
mutationObserver = {
from collections import deque
from itertools import islice, izip_longest
from copy import copy
from functools import reduce
from operator import xor
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return izip_longest(*args, fillvalue=fillvalue)