示例#1
0
"""TODO: High-level file comment."""

import sys


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)
import setup
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement

driver = setup.MakeDriver(user="******")

driver.Click([[By.NAME, 'close-notification']])

driver.ExpectContains([[By.NAME, 'game-summary-box']],
                      '60')  # current stun timer

# Go to the Rules page, change the rules
driver.DrawerMenuClick('mobile-main-page', 'Rules')
driver.Click([[By.NAME, 'rules-card'], [
    By.NAME, 'rules-icon'
]])  # Flaked once on remote, another icon would have received click -verdagon
driver.SendKeys([[By.NAME, 'rules-card'], [By.TAG_NAME, 'textarea']],
                'rules are cools')

# If you click Cancel, the new words shouldn't show up.
示例#2
0
# Test Setup
playerNames = {
    'zella': 'ZellaTheUltimate',
    'deckerd': 'DeckerdTheHesitant',
    'moldavi': 'MoldaviTheMoldavish',
    'drake': 'Drackan',
    'zeke': 'Zeke',
    'jack': 'JackSlayerTheBeanSlasher'
}

xpathToUnseen = "//*[contains(@id, 'drawerChatItem-%s')]//div[contains(@name, 'unseenIcon')]"

# Start Test
actingPlayer = 'zella'  # admin human
actingPlayerName = playerNames[actingPlayer]
driver = setup.MakeDriver()
driver.WaitForGameLoaded()

# Open the drawer if we need to
if driver.is_mobile:
    driver.Click([[By.CLASS_NAME, 'visible-page'], [By.CLASS_NAME, 'header'],
                  [By.NAME, 'drawerButton']]),

# Empty chat shouldn't have an unseen badge
driver.DontFindElement([[By.XPATH, xpathToUnseen % 'Global Chat']])

# Chats with messages should have an unseen badge
driver.FindElement([[By.XPATH, xpathToUnseen % 'Resistance Comms Hub']])
driver.FindElement([[By.XPATH, xpathToUnseen % 'My Chat Room!']])

# Only desktop has chats on the dashboard
示例#3
0
import sys
import pdb
import setup
from selenium.webdriver.common.by import By


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)

# Sign in as a normal human.
driver = setup.MakeDriver(user="******")

# It's a dark and lonely night. The rash young human Jack is walking alone, unguarded, when
# the sly zombie Zeke leaps from a bush and tears out his brain!

# Jack self-infects
driver.DrawerMenuClick('mobile-main-page', 'Infect')
driver.SendKeys([[By.ID, 'lifeCodeInput'], [By.TAG_NAME, 'input']],
                'grobble-forgbobbly')  # Jack's code
driver.Click([[By.ID, 'infect']])
driver.ExpectContains(
    [[By.NAME, 'infect-card'], [By.ID, 'selfInfectedMessage']],
    'Welcome to the horde!')

# TODO(aliengirl): Do we want/need an "are you sure" popup?
示例#4
0
# limitations under the License.
"""TODO: High-level file comment."""

import sys


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)
import setup
from selenium.webdriver.common.by import By

driver = setup.MakeDriver(user="******", page="/createGame", populate=False)

# Create game
driver.Click([[By.ID, 'createGame']])
driver.SendKeys([[By.ID, 'idInput'], [By.TAG_NAME, 'input']],
                driver.GetGameId())
driver.SendKeys([[By.ID, 'nameInput'], [By.TAG_NAME, 'input']], 'My Game')
driver.SendKeys([[By.ID, 'stunTimerInput'], [By.TAG_NAME, 'input']], '60')
# Set game start time to sometime in the past
driver.Backspace([[By.ID, 'form-section-start-time'], [By.ID, 'year'],
                  [By.TAG_NAME, 'input']], 4)
driver.SendKeys([[By.ID, 'form-section-start-time'], [By.ID, 'year'],
                 [By.TAG_NAME, 'input']], "2016")

# Set the declare resistance and declare horde end times to sometime in the future
driver.Backspace([[By.ID, 'form-section-declare-resistance-end-time'],
示例#5
0
            assert oldTime >= maxTime, "%d is not greater than or equal to %d" % (
                oldTime, maxTime)
        else:
            assert newTime < maxTime, "%d is not less than %d" % (newTime,
                                                                  maxTime)
    return newTime


if __name__ == '__main__':
    main(sys.argv)
import setup
from selenium.webdriver.common.by import By

INTITIAL_TIMER = 60

driver = setup.MakeDriver(user="******")

if driver.is_mobile:
    driver.FindElement([[By.NAME, 'stuntimer-box']])

driver.DrawerMenuClick('mobile-main-page', 'Stun Timer')

# Check that the timer actually counts down when you press start/stop
driver.ExpectAttributeEqual(
    [[By.NAME, 'stuntimer-card'], [By.NAME, 'timer-startstop']], "innerText",
    "START")
driver.Click([[By.NAME, 'stuntimer-card'], [By.NAME, 'timer-startstop']])
driver.ExpectAttributeEqual(
    [[By.NAME, 'stuntimer-card'], [By.NAME, 'timer-startstop']], "innerText",
    "STOP")
time.sleep(2)
示例#6
0
import sys


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)
import sys
from driver import WholeDriver
import setup

from selenium.webdriver.common.by import By

driver = setup.MakeDriver(user="******")

# Make sure that an undeclared person can see rules, global chat, no missions: TODO(aliengirl): add this (and update declarezombie.py:35 if necessary)
driver.DrawerMenuClick('mobile-main-page', 'Rules')
driver.FindElement([[By.NAME, 'rules-card']])
driver.DrawerMenuClick('rules-card', 'Global Chat')
driver.DrawerMenuClick('chat-card', 'Dashboard')

# Time for Deckerd to choose a side
driver.RetryUntil(
    lambda: driver.Click([[By.NAME, 'declareAllegiance']]),
    lambda: driver.FindElement([[By.NAME, 'joinGameStartingZombiePage'],
                                [By.NAME, 'option0']]))

# Choose zombie!
driver.RetryUntil(
示例#7
0
"""TODO: High-level file comment."""

import sys


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)
import setup
from selenium.webdriver.common.by import By

driver = setup.MakeDriver(user="******")

if driver.is_mobile:
  # Moldavi shares his location
  driver.DrawerMenuClick('Global Chat')
  driver.Click([[By.TAG_NAME, 'ghvz-chat-location'], [By.TAG_NAME, 'paper-icon-button']])
  driver.RetryUntil(
    lambda : True,
    lambda: driver.FindElement([[By.NAME, 'map-ready']]))
  driver.Click([[By.ID, 'sendLocationForm'], [By.ID, 'done']])
  # NOTE: don't blindly copy this, it's very risky to use FindElement's return value.
  location = driver.FindElement([[By.NAME, 'message-Global Chat-'], [By.ID, 'mapContainer']])
  location = location.get_attribute('src')
  assert "https://maps.googleapis.com/maps/api/staticmap" in location;

  # Jack can see it
示例#8
0
# limitations under the License.
"""TODO: High-level file comment."""

import sys


def main(argv):
    pass


if __name__ == '__main__':
    main(sys.argv)
import setup
from selenium.webdriver.common.by import By

driver = setup.MakeDriver(user="******")

driver.Click([[By.NAME, 'joinGame']])

driver.Click([[By.NAME, 'joinGameIntroNext']])

driver.Click([[By.NAME, 'joinGameGfitNext']])

driver.SendKeys([[By.NAME, 'joinGameNamePage'], [By.TAG_NAME, 'paper-input'],
                 [By.TAG_NAME, 'input']], 'ReggieTheRavager')

driver.Click([[By.NAME, 'joinGameNamePage'], [By.TAG_NAME, 'paper-button']])

driver.Click([[By.NAME, 'joinGameBandPage'], [By.NAME, 'option1']])

driver.Click([[By.NAME, 'joinGameBandInfoPageNext']])