Giter Site home page Giter Site logo

uat's Introduction

Welcome to Adventurer’s Codex

Experience the next step in tabletop RPGs

What is it?

A fun, easy to use, Open Source tool for tabletop RPG players to manage their characters, campaigns, and parties. Our goal is to help you focus more on the game by bringing your paper character sheets into the 21st century.

Check out the site, or follow our blog.

For Players

Keep track of you character's equipment, skills, spells, saving throws, and more. Say goodbye to that eraser-marked character sheet, and say hello to the future!

For DMs

Manage your campaign by keeping track of enemies, and friendly NPCs, as well as any notes, maps, custom items, and whatever else you've created!

For Entire Parties

Take advantage of innovative features like group chat, party dashboard, and a combat management tool!

Getting Started

Adventurer's Codex is hosted at adventurerscodex.com, and you can use the app for free there.

Have questions or just want to chat?

Join the conversations on Discord or chat with us in the issues. We tend to hold a lot of discussions there and new features are always being hashed out. We'd love your feedback.

How can I contribute?

You should check out our Contributing wiki! We'd love the help! There you'll find information on how to set up your dev environment and how to submit PRs for new features and bugs. We have a slightly different branch structure than a lot of projects so please read our guidelines before starting. We don't want you to write the next big fix or feature and not be able to PR it.

If you're already familiar with contributing to open source projects, check out our Issue Label Guide to see what kind of tickets are available and what they mean.

uat's People

Contributors

alejandroke avatar jkrooskos avatar seankipp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uat's Issues

Create a spell factory

For reference:

class AbstractSpell(models.Model):
name = models.CharField(max_length=40)
type = models.CharField(max_length=40, default='')
damage = models.CharField(max_length=40, default='')
damage_type = models.CharField(max_length=40, default='')
school = models.CharField(max_length=40, default='')
level = models.IntegerField(default=0)
description = models.TextField(blank=True, null=True)
material_components = models.TextField(blank=True, null=True)
is_ritual = models.BooleanField(default=False)
prepared = models.BooleanField(default=False)
always_prepared = models.BooleanField(default=False)
casting_time = models.CharField(max_length=100, default='')
components = models.TextField(default='')
duration = models.TextField(default='')
range = models.TextField(default='')
duration = models.TextField(default='')

Bug: TimeoutException - test_tracked_increase_decrease

Browser

Firefox

Test File

tests/core/player_tools/test_skills.py:853

Propsed Fix

Add an expected condition (clickable) for tracked_table.tracked1_used_up.click()

Stacktrace

player_wizard = None
browser = <selenium.webdriver.firefox.webdriver.WebDriver (session="30449ccc-cc91-f74d-ae5a-cb9dd048c9af")>

    def test_tracked_increase_decrease(player_wizard, browser): # noqa
        """As a player, I can increase or decrease tracked abilities with the
           stepper widget and the bar reflects these changes."""

        print(('As a player, I can increase or decrease tracked abilities with '
               'the stepper widget and the bar reflects these changes.'))

        feature = features.FeatureAddModal(browser)
        features_table = features.FeaturesTable(browser)
        tracked_table = tracked.TrackedTable(browser)
        tabs = Tabs(browser)
        tabs.skills.click()

        features_table.add.click()
        feature.name = 'Add Name'
        feature.class_ = 'Add Class'
        feature.level = 1
        feature.description = 'Add Description'
        feature.tracked.click()
        feature.max_ = 4
        feature.short_rest.click()

        feature.add.click()

>       tracked_table.tracked1_used_up.click()

tests/core/player_tools/test_skills.py:853:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
component_objects/__init__.py:39: in __get__
    (self.locating_key, self.locating_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <selenium.webdriver.support.wait.WebDriverWait (session="30449ccc-cc91-f74d-ae5a-cb9dd048c9af")>
method = <selenium.webdriver.support.expected_conditions.visibility_of_element_located object at 0x1071bff28>
message = ''

    def until(self, method, message=''):
        """Calls the method provided with the driver as an argument until the \
            return value is not False."""
        screen = None
        stacktrace = None

        end_time = time.time() + self._timeout
        while True:
            try:
                value = method(self._driver)
                if value:
                    return value
            except self._ignored_exceptions as exc:
                screen = getattr(exc, 'screen', None)
                stacktrace = getattr(exc, 'stacktrace', None)
            time.sleep(self._poll)
            if time.time() > end_time:
                break
>       raise TimeoutException(message, screen, stacktrace)
E       selenium.common.exceptions.TimeoutException: Message:

../../../.virtualenvs/selenium/lib/python3.5/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException ```

Conftest: firefox misconfigured

This code:

elif web_driver.lower() == 'firefox':
    driver = webdriver.Safari()

Should be changed to:

elif web_driver.lower() == 'firefox':
    driver = webdriver.Firefox()

Refactor modal finished closing

Proposed Refactor

The expected condition, modal_finished_closing no longer requires an element as a parameter. This should be removed from the init method, and all calls to this function should no longer require a parameter.

The file is located in expected_conditions/conditions

Factory: Environment

Factory Name

Environment

Module

DM

Factory Spec

Image Link (URL)
Weather (length=40, prefix='Weather_')
Terrain (length=40, prefix='Terrain_')
Description (length=150, prefix='Description_')

Rename conditions.py

  • Rename uat/expected_conditions/conditions.py to uat/expected_conditions/general.py
  • Update import statements

Discussion: selenium id naming convention

The proposed convention for id's follows the below pattern:

non-modals:

component/name_of_field/element_type

modals:

component/add_or_edit/name_of_field/element_type

Examples:

  • armorAddIcon
  • armorDeleteIcon
  • profileAlignmentInput
  • armorAddTypeInput
  • armorEditNameInput

Factory: Read Aloud Text

Factory Name

Read Aloud Text (factories/core/dm/read_aloud_text.py)

Module

DM

Factory Spec

Name (length=40, prefix='Name_')
Description (length=150, prefix='Description_')

Rename utils.py

  • Rename uat/utils/utils.py to uat/utils/general.py
  • Update import statements

test_markdown_cheatsheet fails

test_markdown_cheatsheet_link _______________________________________________________________________________________

player_wizard = None, browser = <selenium.webdriver.safari.webdriver.WebDriver (session="0DC130F3-B892-48A7-AE6A-188CD528C56A")>

def test_markdown_cheatsheet_link(player_wizard, browser): # noqa
    """As a player, I can click on the link to the markdown guide."""
    print('As a player, I can click on the link to the markdown guide.')
    notes_list = NotesList(browser)
    notes_detail = NotesDetail(browser)

    tabs = Tabs(browser)
    tabs.notes.click()

    notes_list.add.click()
    notes_detail.edit_textarea = 'Test Note 1'

    notes_detail.markdown_cheatcheat.click()
    WebDriverWait(browser, 20).until(EC.number_of_windows_to_be(2))
    browser.switch_to.window(browser.window_handles[1])
  WebDriverWait(browser, 20).until(url_in_new_tab_matches('https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet'))

NOTE:

These seem to be intermittent with the safari browser

Remove instances of '\t' in the tests

This was used to simulate a tab after entering data in an element. A better way to do this is the following:

from selenium.webdriver.common.keys import Keys

element.send_keys(Keys.TAB)

Below are the occurrences that should be replaced:

tests/core/dm_tools/test_overview.py: dm_overview.setting = 'The Lost World\t'
tests/core/dm_tools/test_overview.py: dm_overview.dm_name = 'Automated Testing Bot\t'
tests/core/player_tools/test_inventory.py: coins_table.copper = '100\t'
tests/core/player_tools/test_inventory.py: coins_table.copper = '49\t'
tests/core/player_tools/test_inventory.py: coins_table.copper = '50\t'
tests/core/player_tools/test_profile.py: profile.name = 'Gandalf\t'
tests/core/player_tools/test_profile.py: profile.background = 'Sage\t'
tests/core/player_tools/test_profile.py: profile.alignment = 'Chaotic Good\t'
tests/core/player_tools/test_profile.py: profile.deity = 'Moridin\t'
tests/core/player_tools/test_profile.py: profile.race = 'Gnome\t'
tests/core/player_tools/test_profile.py: profile.class_ = 'Fighter\t'
tests/core/player_tools/test_profile.py: profile.gender = 'Male\t'
tests/core/player_tools/test_profile.py: profile.age = '12\t'
tests/core/player_tools/test_profile.py: background.traits = 'Traits...\t'
tests/core/player_tools/test_profile.py: background.ideals = 'Ideals...\t'
tests/core/player_tools/test_profile.py: background.bonds = 'Bonds...\t'
tests/core/player_tools/test_profile.py: background.flaws = 'Flaws...\t'
tests/core/player_tools/test_profile.py: appearance.height = '5ft\t'
tests/core/player_tools/test_profile.py: appearance.weight = '165\t'
tests/core/player_tools/test_profile.py: appearance.hair_color = 'Brown\t'
tests/core/player_tools/test_profile.py: appearance.eye_color = 'Brown\t'
tests/core/player_tools/test_profile.py: appearance.skin_color = 'Fair\t'
tests/core/player_tools/test_equipment.py: armor_add.stealth = 'Disadvantage\t'
tests/core/player_tools/test_equipment.py: armor_edit.stealth = 'Advantage\t'

test_preview_armor fails

def test_preview_armor(player_wizard, browser): # noqa
    """As a player, I can select a row in the armor table and view the item
       in the preview tab."""
    print(('As a player, I can select a row in the armor table and view '
           'the item in the preview tab'))

    armor_add = armor.ArmorAddModal(browser)
    armor_table = armor.ArmorTable(browser)
    armor_preview = armor.ArmorPreviewModal(browser)
    tabs = Tabs(browser)
    tabs.equipment.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, armor_table.add_id)
        )
    )

    armor_table.add.click()
    ut.select_from_autocomplete(
        armor_add,
        'name',
        browser,
        has_search_term=False
    )
    armor_add.add.click()

    WebDriverWait(browser, 10).until(
        modal_finished_closing(armor_add.modal_div_id)
    )

    row = ut.get_table_row(armor_table, 'table', values=False)
    row[0].click()

    WebDriverWait(browser, 10).until(
        EC.text_to_be_present_in_element(
          (By.ID, armor_preview.name_id), 'Breastplate'
        )
    )

TIMEOUT Exception

Factory: Note

Factory Name

Notes

Module

DM

Factory Spec

Note (length=15, prefix='Content_')

Create a background factory

For reference:

class Background(CoreBaseModel):
name = models.CharField(max_length=40)
ideal = models.TextField(default='')
flaw = models.TextField(default='')
bond = models.TextField(default='')
personality_trait = models.TextField(default='')

Utils: add switch tab function

Add the below function to utils.py

def switch_tab(tab_name, browser):
# it should switch the tab to the specified tab name

Resource Warning

Running the tests on chromedriver on OSX sometimes yields these errors:

tests/dm_tools/test_screen.py::test_screen
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/email/feedparser.py:86: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 54103), raddr=('127.0.0.1', 54091)>
for ateof in reversed(self._eofstack):

tests/player_tools/test_profile.py::test_class_autocomplete
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py:1053: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 54257), raddr=('127.0.0.1', 54245)>
for i, one_value in enumerate(values):
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py:1053: ResourceWarning: unclosed <socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 54333), raddr=('127.0.0.1', 54321)>
for i, one_value in enumerate(values):

-- Docs: http://doc.pytest.org/en/latest/warnings.html

Add Item Factory

name = models.CharField(max_length=40)
description = models.TextField(blank=True, null=True)
quantity = models.IntegerField(default=1)
weight = models.IntegerField(default=0)
cost = models.IntegerField(default=0)
currency_denomination = models.CharField(max_length=10, blank=True, null=True)

Factory: PointOfInterest

Factory Name

PointOfInterest

Module

DM

Factory Spec

Name (length=40, prefix='Name_')
Description (length=150, prefix='Description_')

Bug: test_wizard_backpack_prepop

Browser

Safari

Test File

Wizard.py

Stacktrace

def test_wizard_backpack_prepop(browser): # noqa
"""As a player, after selecting a backpack, all items are pre-populated in the inventory
module."""
print(('As a player, after selecting a backpack, all items are pre-populated in the '
'inventory module.'))

    wizard_main = NewCharacterCampaign(browser)
    who_are_you = wizard.WhoAreYou(browser)
    ability_scores = wizard.AbilityScoresManual(browser)
    tabs = Tabs(browser)
    inventory_table = inventory.InventoryTable(browser)

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.get_started_id)
        )
    )

    wizard_main.get_started.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.player_id)
        )
    )

    wizard_main.player.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.next_id)
        )
    )

    wizard_main.next_.click()

    who_are_you.character_name = 'Test Char'
    who_are_you.player_name = 'Automated Testing Bot.'

    backpack = Select(browser.find_element_by_id(who_are_you.backpack_id))
    backpack.select_by_index(1)

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.next_id)
        )
    )

    wizard_main.next_.click()

    ability_scores.strength = '18'
    ability_scores.dexterity = '18'
    ability_scores.constitution = '18'
    ability_scores.intelligence = '18'
    ability_scores.wisdom = '18'
    ability_scores.charisma = '18'

    wizard_main.finish.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
          (By.ID, tabs.inventory_id)
        )
    )

Timeout

test_edit_weapon fails

def test_edit_weapon(player_wizard, browser): # noqa
    """As a player, I can edit a weapon."""
    print('As a player, I can edit a weapon.')

    weapon_add = weapon.WeaponAddModal(browser)
    weapon_edit = weapon.WeaponEditModal(browser)
    weapon_table = weapon.WeaponTable(browser)
    weapon_tabs = weapon.WeaponModalTabs(browser)
    tabs = Tabs(browser)
    tabs.equipment.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, weapon_table.add_id)
        )
    )

    weapon_table.add.click()
    ut.select_from_autocomplete(
        weapon_add,
        'name',
        browser,
        has_search_term=False
    )
    weapon_add.add.click()

    WebDriverWait(browser, 10).until(
        modal_finished_closing(weapon_add.modal_div_id)
    )

    rows = ut.get_table_rows(weapon_table, 'table', values=False)
    rows[0][0].click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, weapon_tabs.edit_id)
        )
    )

    weapon_tabs.edit.click()

    WebDriverWait(browser, 10).until(
        EC.presence_of_element_located(
            (By.ID, weapon_edit.name_id)
        )
    )

    weapon_edit.name = 'Edit Name'
    weapon_edit.damage = '1d10'
    weapon_edit.magical_modifier = 2
    weapon_edit.to_hit_modifier = 2
    weapon_edit.type_ = 'Melee'
    weapon_edit.handedness = 'One-Handed'
    weapon_edit.proficiency = 'Simple'
    weapon_edit.price = 200
    weapon_edit.currency_denomination = 'GP'
    weapon_edit.weight = 200
    weapon_edit.range_ = 5
    weapon_edit.damage_type = 'Slashing'
    weapon_edit.property_ = 'Versatile'
    weapon_edit.quantity = 2
    weapon_edit.description = 'Edit Description'

    assert weapon_edit.name.get_attribute('value').strip() == 'Edit Name'
    assert weapon_edit.damage.get_attribute('value').strip() == '1d10'
    assert weapon_edit.magical_modifier.get_attribute('value').strip() == '2'
    assert weapon_edit.to_hit_modifier.get_attribute('value').strip() == '2'
    assert weapon_edit.type_.get_attribute('value').strip() == 'Melee'
    assert weapon_edit.handedness.get_attribute('value').strip() == 'One-Handed'
    assert weapon_edit.proficiency.get_attribute('value').strip() == 'Simple'
    assert weapon_edit.price.get_attribute('value').strip() == '200'
    assert weapon_edit.currency_denomination.get_attribute('value').strip() == 'GP'
    assert weapon_edit.weight.get_attribute('value').strip() == '200'
    assert weapon_edit.range_.get_attribute('value').strip() == '5'
    assert weapon_edit.damage_type.get_attribute('value').strip() == 'Slashing'
    assert weapon_edit.property_.get_attribute('value').strip() == 'Versatile'
    assert weapon_edit.quantity.get_attribute('value').strip() == '2'
    assert weapon_edit.description.get_attribute('value').strip() == 'Edit Description'

    weapon_edit.done.click()

    WebDriverWait(browser, 10).until(
        modal_finished_closing(weapon_edit.modal_div_id)
    )

    row = ut.get_table_row(weapon_table, 'table', 1)
  assert row.weapon.strip() == 'Edit Name  + 2'

E AssertionError: assert 'Edit Name\xa... + 2' == 'Edit Name + 2'
E + Edit Name + 2
E - Edit Name
E - + 2

Bug: TimeoutException - test_tracked_reset

Browser

Firefox

Test File

tests/core/player_tools/test_skills.py:885

Propsed Fix

Add an expected condition (clickable) for tracked_table.tracked1_used_up.click()

Stacktrace

player_wizard = None
browser = <selenium.webdriver.firefox.webdriver.WebDriver (session="a2191b01-29f2-9642-af32-7dbd2cbf1f72")>

    def test_tracked_reset(player_wizard, browser): # noqa
        """As a player, I can reset a tracked ability by clicking on the reset
           icon."""

        print(('As a player, I can reset a tracked ability by clicking on the '
               'reset icon.'))

        feature = features.FeatureAddModal(browser)
        features_table = features.FeaturesTable(browser)
        tracked_table = tracked.TrackedTable(browser)
        tabs = Tabs(browser)
        tabs.skills.click()

        features_table.add.click()
        feature.name = 'Add Name'
        feature.class_ = 'Add Class'
        feature.level = 1
        feature.description = 'Add Description'
        feature.tracked.click()
        feature.max_ = 4
        feature.short_rest.click()

        feature.add.click()

>       tracked_table.tracked1_used_up.click()

tests/core/player_tools/test_skills.py:885:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
component_objects/__init__.py:39: in __get__
    (self.locating_key, self.locating_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <selenium.webdriver.support.wait.WebDriverWait (session="a2191b01-29f2-9642-af32-7dbd2cbf1f72")>
method = <selenium.webdriver.support.expected_conditions.visibility_of_element_located object at 0x1073f4400>
message = ''

    def until(self, method, message=''):
        """Calls the method provided with the driver as an argument until the \
            return value is not False."""
        screen = None
        stacktrace = None

        end_time = time.time() + self._timeout
        while True:
            try:
                value = method(self._driver)
                if value:
                    return value
            except self._ignored_exceptions as exc:
                screen = getattr(exc, 'screen', None)
                stacktrace = getattr(exc, 'stacktrace', None)
            time.sleep(self._poll)
            if time.time() > end_time:
                break
>       raise TimeoutException(message, screen, stacktrace)
E       selenium.common.exceptions.TimeoutException: Message:

../../../.virtualenvs/selenium/lib/python3.5/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException

Factory: Coins

Factory Name

Coins

Module

DM

Factory Spec

Platinum (integer 0-1000000)
Gold (integer 0-1000000)
Electrum (integer 0-1000000)
Silver (integer 0-1000000)
Copper (integer 0-1000000)

Rename element.py

  • Rename uat/modules/element.py to uat/component_objects/init.py
  • Fix imports

test_weapon_magical_modifier fails

player_wizard = None, browser = <selenium.webdriver.safari.webdriver.WebDriver (session="CD5B7CB6-7249-4FC3-A736-DA9A7A022F68")>

def test_weapon_magical_modifier(player_wizard, browser): # noqa
    """As a player, if weapon is magical, a badge indicating the modifier
       is present."""
    print(('As a player, if weapon is magical, a badge indicating the '
           'modifier is present.'))

    weapon_add = weapon.WeaponAddModal(browser)
    weapon_table = weapon.WeaponTable(browser)
    tabs = Tabs(browser)
    tabs.equipment.click()

    weapon_table.add.click()
    weapon_add.name = 'Add Name'
    weapon_add.magical_modifier = 3

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, weapon_table.add_id)
        )
    )

    weapon_add.add.click()

    WebDriverWait(browser, 10).until(
        modal_finished_closing(weapon_add.modal_div_id)
    )

    row = ut.get_table_row(weapon_table, 'table', 1)
  assert row.weapon.strip() == 'Add Name  + 3'

E AssertionError: assert 'Add Name\xa0... + 3' == 'Add Name + 3'
E + Add Name + 3
E - Add Name
E - + 3

Factory: Create feat factory

Factory Name

feat

Factory Spec

name = models.CharField(max_length=125)
description = models.TextField(blank=True, null=True)

Factory: MapImage

Factory Name

MapImage

Module

DM

Factory Spec

Name (length=40, prefix='Name_')
Link (random url)
Description (length=150, description='Description_')

Create appearance factory

weight = models.IntegerField(default=0, blank=True, null=True)
height = models.CharField(max_length=40, blank=True, null=True)
hair_color = models.CharField(max_length=40, blank=True, null=True)
eye_color = models.CharField(max_length=40, blank=True, null=True)
skin_color = models.CharField(max_length=40, blank=True, null=True)

Add Magic Items Factory

name = models.CharField(max_length=40)
type = models.CharField(max_length=40)
rarity = models.CharField(max_length=40)
requires_attunement = models.BooleanField(default=False)
attuned = models.BooleanField(default=False)
max_charges = models.IntegerField(default=0)
used_charges = models.IntegerField(default=0)
weight = models.IntegerField(default=0)
description = models.TextField(blank=True, null=True)

Factory: NPC

Factory Name

NPC

Module

DM

Factory Spec

Name (length=40, prefix='Name_')
Race (length=40, prefix='Race_')
Description (length=150)

test_add_armor fails

player_wizard = None, browser = <selenium.webdriver.safari.webdriver.WebDriver (session="E01B3898-7AB8-4C23-962D-9CF3E6F8364E")>

def test_add_armor(player_wizard, browser): # noqa
    """As a player, I can add an armor."""
    print('As a player, I can add an armor.')

    armor_add = armor.ArmorAddModal(browser)
    armor_table = armor.ArmorTable(browser)
    tabs = Tabs(browser)
    tabs.equipment.click()

    stub = ArmorFactory.stub()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, armor_table.add_id)
        )
    )

    armor_table.add.click()
    armor_add.name = stub.name
    armor_add.type_ = stub.type_
    armor_add.magical_modifier = stub.magical_modifier
    armor_add.price = stub.price
    armor_add.currency_denomination = stub.currency_denomination
    armor_add.weight = stub.weight
    armor_add.armor_class = stub.armor_class
    armor_add.stealth = stub.stealth
    armor_add.stealth.send_keys(Keys.TAB)
    armor_add.don.click()
    armor_add.description = stub.description

    assert armor_add.name.get_attribute('value').strip() == stub.name
    assert armor_add.type_.get_attribute('value').strip() == stub.type_
    assert int(armor_add.magical_modifier.get_attribute('value').strip()) == stub.magical_modifier
    assert int(armor_add.price.get_attribute('value').strip()) == stub.price
    assert armor_add.currency_denomination.get_attribute('value').strip() == stub.currency_denomination
    assert int(armor_add.weight.get_attribute('value').strip()) == stub.weight
    assert int(armor_add.armor_class.get_attribute('value').strip()) == stub.armor_class
    assert armor_add.stealth.get_attribute('value').strip() == stub.stealth
    assert 'active' in armor_add.don.get_attribute('class').strip()
    assert armor_add.description.get_attribute('value').strip() == stub.description

    armor_add.add.click()

    row = ut.get_table_row(armor_table, 'table', 1)
  assert row.armor.strip() == '{}  + {}'.format(
        stub.name, stub.magical_modifier
    )

E AssertionError: assert 'Armor_tbpmcu... + 2' == 'Armor_tbpmcuc...lJFInQxb + 2'
E - Armor_tbpmcucmHacqeCxNqPCfurhlVQTghwyJlJFInQxb
E ? ^^
E + Armor_tbpmcucmHacqeCxNqPCfurhlVQTghwyJlJFInQxb + 2
E ? ^^^^^
E - + 2

Factory: Monster

Factory Name

Monster

Module

DM

Factory Spec

Name (length=40, prefix='Name_')
Size (length=40, prefix='Size_')
Type (length=40, prefix='Type_')
Alignment (length=40, prefix='Alignment_')
ArmorClass (length=40, prefix='ArmorClass_')
Hit Points (length=40, prefix='HitPoints_')
Speed (length=40, prefix='Speed_')
Strength (integer, 0-100)
Dexterity (integer, 0-100)
Constitution (integer, 0-100)
Intelligence (integer, 0-100)
Wisdom (integer, 0-100)
Charisma (integer, 0-100)
Saving Throws (length=40, prefix='Saving_Throws_')
Skills (length=40, prefix='Skills_')
Damage Immunities (length=40, prefix='Damage_Immunities_')
Damage Vulnerabilities (length=40, prefix='Damage_Vulnerabilities_')
Damage Resistances (length=40, prefix='Damage_Resistances_')
Condition Immunities (length=40, prefix='Condition_Immunities_')
Senses (length=40, prefix='Senses_')
Languages (length=40, prefix='Languages_')
Challenge (length=40, prefix='Challenge_')
Experience (length=40, prefix='Experience_')
Description (length=150, prefix='Description_')

player_wizard intermittent bug

@pytest.fixture(scope='function')
def player_wizard(browser):
    """Navigate through the player wizard."""
    wizard_main = NewCharacterCampaign(browser)
    who_are_you = wizard.WhoAreYou(browser)
    ability_scores = wizard.AbilityScoresManual(browser)

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.get_started_id)
        )
    )

    wizard_main.get_started.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.player_id)
        )
    )

    wizard_main.player.click()

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
            (By.ID, wizard_main.next_id)
        )
    )

    wizard_main.next_.click()

    who_are_you.character_name = 'Test Char'
    who_are_you.player_name = 'Automated Testing Bot.'

    WebDriverWait(browser, 10).until(
        EC.element_to_be_clickable(
          (By.ID, wizard_main.next_id)
        )
    )

conftest.py:138:


self = <selenium.webdriver.support.wait.WebDriverWait (session="32cdc511-263c-aa41-a8ed-3889b236b539")>
method = <selenium.webdriver.support.expected_conditions.element_to_be_clickable object at 0x10f035208>, message = ''

def until(self, method, message=''):
    """Calls the method provided with the driver as an argument until the \
        return value is not False."""
    screen = None
    stacktrace = None

    end_time = time.time() + self._timeout
    while True:
        try:
            value = method(self._driver)
            if value:
                return value
        except self._ignored_exceptions as exc:
            screen = getattr(exc, 'screen', None)
            stacktrace = getattr(exc, 'stacktrace', None)
        time.sleep(self._poll)
        if time.time() > end_time:
            break
  raise TimeoutException(message, screen, stacktrace)

E selenium.common.exceptions.TimeoutException: Message:

../../../.virtualenvs/selenium/lib/python3.5/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException

test_delete_feat test fails

def test_delete_feat(player_wizard, browser): # noqa
    """As a player, I can delete a feat."""
    print('As a player, I can delete a feat.')

    feat = feats.FeatAddModal(browser)
    feats_table = feats.FeatsTable(browser)
    tabs = Tabs(browser)
    tabs.skills.click()

    feats_table.add.click()
    ut.select_from_autocomplete(
        feat,
        'name',
        browser,
        has_search_term=False
    )
    feat.add.click()

    rows = ut.get_table_rows(feats_table, 'table', values=False)

    WebDriverWait(browser, 10).until(
        EC.invisibility_of_element_located(
            (By.ID, 'addFeat')
        )
    )
  rows[0][1].click()

Error: Another element obscures it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.