test_github_register.py 870 Bytes
Newer Older
1
import pytest
2 3
import string
import random
4 5 6 7 8 9 10 11 12
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from github_register import *

class TestRegisteration:

13
    def test_github_account(self):
14

15 16 17 18 19 20 21
        random_id = ''.join([random.choice(string.ascii_letters
            + string.digits) for n in range(8, 18)])

        random_string = random_id 

        user_email = random_string + "@xyz.com"
        username = random_string
22 23 24
        github_account(username, user_email, "testpassword1234")
        WebDriverWait(browser, 10)
        text="You’ve taken your first step into a larger world, @" + username + "."
25
        assert browser.find_element_by_class_name("lead").text == text