Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webapp/webapp/features/dependencies_information_for_opt_id.py
blob: 7b1de23a85e221a3ee8377e188c41ac28b41a267 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
import os

from lettuce import step, world
from fabric.api import local
from django.conf import settings
from nose.tools import assert_true


@step(u'And poll in fixture: "([^"]*)"')
def and_poll_in_fixture_fixture_name(step, fixture_name):
    location = lambda x: os.path.join(
        os.path.dirname(os.path.realpath(__file__)),
        "fixtures",
        fixture_name,
        x
    )
    db_name = settings.MONGO_SETTINGS['NAME']
    polls_fixture = location("polls.bson")
    local(
        "mongorestore --collection polls --db %s "
        "%s" % (db_name, polls_fixture))
    structures_fixture = location("structures.bson")
    local(
        "mongorestore --collection structures --db %s "
        "%s" % (db_name, structures_fixture))


@step(u'And I click in "([^"]*)" dependency id')
def and_i_click_in_dependency_id(step, dependency_id):
    b = world.browser
    b.find_by_value(dependency_id).click()


@step(u'Then I should see a popover')
def see_a_popover(step):
    b = world.browser
    assert_true(b.is_element_present_by_css('.popover'))