Exemple #1
0
def test_profile_persists(player_wizard, browser):
    """Profile inputs should persist data."""
    print('As a player, profile inputs persist data.')
    profile = Profile(browser)

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

    profile.name = 'Gandalf'
    profile.name.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.name.get_attribute('value').strip() == 'Gandalf'

    profile.background = 'Sage'
    profile.background.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.background.get_attribute('value').strip() == 'Sage'

    profile.alignment = 'Chaotic Good'
    profile.alignment.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.alignment.get_attribute('value').strip() == 'Chaotic Good'

    profile.deity = 'Moridin'
    profile.deity.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.deity.get_attribute('value').strip() == 'Moridin'

    profile.race = 'Gnome'
    profile.race.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.race.get_attribute('value').strip() == 'Gnome'

    profile.class_ = 'Fighter'
    profile.class_.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.class_.get_attribute('value').strip() == 'Fighter'

    profile.gender = 'Male'
    profile.gender.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.gender.get_attribute('value').strip() == 'Male'

    profile.age = '12'
    profile.age.send_keys(Keys.TAB)
    browser.refresh()

    assert profile.age.get_attribute('value').strip() == '12'
Exemple #2
0
def test_background_autocomplete(player_wizard, browser): # noqa
    """As a player, if I start typing in the background field, OGL data auto-completes."""
    print('As a player, if I start typing in the background field, OGL data auto-completes.')

    profile = Profile(browser)
    tabs = Tabs(browser)
    tabs.profile.click()

    ut.select_from_autocomplete(
        profile,
        'background',
        browser,
        has_search_term=False
    )

    assert profile.background.get_attribute('value').strip() == 'Acolyte'

    profile.background.clear()

    ut.select_from_autocomplete(
        profile,
        'background',
        browser,
        has_search_term=True,
        search_term='f'
    )

    assert profile.background.get_attribute('value').strip() == 'Folk Hero'
Exemple #3
0
def test_class_autocomplete(player_wizard, browser): # noqa
    """As a player, if I start typing in the class field, OGL data auto-completes."""
    print('As a player, if I start typing in the class field, OGL data auto-completes.')

    profile = Profile(browser)
    tabs = Tabs(browser)
    tabs.profile.click()

    ut.select_from_autocomplete(
        profile,
        'class_',
        browser,
        has_search_term=False
    )

    assert profile.class_.get_attribute('value').strip() == 'Barbarian'

    profile.class_.clear()

    ut.select_from_autocomplete(
        profile,
        'class_',
        browser,
        has_search_term=True,
        search_term='c'
    )

    assert profile.class_.get_attribute('value').strip() == 'Cleric'
Exemple #4
0
def test_race_autocomplete(player_wizard, browser): # noqa
    """As a player, if I start typing in the race field, OGL data auto-completes."""
    print('As a player, if I start typing in the race field, OGL data auto-completes.')

    profile = Profile(browser)
    tabs = Tabs(browser)
    tabs.profile.click()

    ut.select_from_autocomplete(
        profile,
        'race',
        browser,
        has_search_term=False
    )

    assert profile.race.get_attribute('value').strip() == 'Dwarf'

    profile.race.clear()

    ut.select_from_autocomplete(
        profile,
        'race',
        browser,
        has_search_term=True,
        search_term='c'
    )

    assert profile.race.get_attribute('value').strip() == 'Rock Gnome'
Exemple #5
0
def test_alignment_autocomplete(player_wizard, browser): # noqa
    """As a player, if I start typing in the alignment field, OGL data auto-completes."""
    print('As a player, if I start typing in the alignment field, OGL data auto-completes.')

    profile = Profile(browser)
    tabs = Tabs(browser)
    tabs.profile.click()

    ut.select_from_autocomplete(
        profile,
        'alignment',
        browser,
        has_search_term=False
    )

    assert profile.alignment.get_attribute('value').strip() == 'Lawful good'

    profile.alignment.clear()

    ut.select_from_autocomplete(
        profile,
        'alignment',
        browser,
        has_search_term=True,
        search_term='c'
    )

    assert profile.alignment.get_attribute('value').strip() == 'Chaotic good'
Exemple #6
0
def test_wizard_profile_stats(browser):  # noqa
    """As a player, after creating a character via the character creation wizard, I can view all the data entered in the stats and profile modules."""
    print(
        'As a player, after creating a character via the character creation wizard, I can view all the data entered in the stats and profile modules.'
    )
    wizard_main = NewCharacterCampaign(browser)
    who_are_you = wizard.WhoAreYou(browser)
    ability_scores = wizard.AbilityScoresManual(browser)
    tabs = Tabs(browser)
    profile = Profile(browser)
    stats = OtherStats(browser)
    hud = HUD(browser)

    wizard_main.get_started.click()
    wizard_main.player.click()
    wizard_main.next_.click()

    who_are_you.character_name = 'Test Char'
    who_are_you.player_name = 'Automated Testing Bot.'
    ut.select_from_autocomplete(who_are_you, 'alignment', '', browser)
    who_are_you.deity = 'Test Deity'
    ut.select_from_autocomplete(who_are_you, 'race', '', browser)
    ut.select_from_autocomplete(who_are_you, 'class_', '', browser)
    who_are_you.gender = 'Test Male'
    who_are_you.age = 21
    ut.select_from_autocomplete(who_are_you, 'background', '', browser)
    who_are_you.level = 3
    who_are_you.experience = 1000

    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()

    tabs.profile.click()

    assert profile.name.get_attribute('value') == 'Automated Testing Bot.'
    assert profile.background.get_attribute('value') == 'Acolyte'
    assert profile.alignment.get_attribute('value') == 'Lawful good'
    assert profile.deity.get_attribute('value') == 'Test Deity'
    assert profile.race.get_attribute('value') == 'Dwarf'
    assert profile.class_.get_attribute('value') == 'Barbarian'
    assert profile.gender.get_attribute('value') == 'Test Male'
    assert profile.age.get_attribute('value') == '21'

    tabs.stats.click()

    assert stats.level.get_attribute('value') == '3'
    assert stats.experience.get_attribute('value') == '1000'