class EventCreateTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.kindergifts = EventCreatePage(self.driver)
        self.ts = TestStatus(self.driver)
        self.lp = LoginPage(self.driver)

    def setUp(self):
        self.kindergifts.click_logo_button()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/rade_dragosavac/PycharmProjects/framework/config_files/test_data.csv"
    ))
    @unpack
    def test_valid_creating_event(self, event_name, event_title, celebrant,
                                  host, city, username, password):
        self.kindergifts.create_design(event_name, event_title, celebrant,
                                       host, city)
        result1 = self.kindergifts.verify_step_created_successfully()
        self.ts.mark(result1, "Design created successfully")
        self.kindergifts.add_gift()
        result2 = self.kindergifts.verify_step_created_successfully()
        self.ts.mark(result2, "Gift added successfully")
        self.kindergifts.add_charity()
        result3 = self.kindergifts.verify_step_created_successfully()
        self.ts.mark(result3, "Charity added successfully")
        time.sleep(2)
        self.lp.login(username, password)
        time.sleep(2)
        self.kindergifts.go_to_event_details_page()
        result4 = self.kindergifts.verify_event_created()
        self.ts.mark(result4, "Event created successfully")
        self.kindergifts.delete_event()
        result5 = self.kindergifts.verify_element_deleted_successfully()
        self.ts.mark_final("test_valid_creating_event", result5,
                           "Event is deleted and Test -> Passed")
        self.kindergifts.log_out()
        time.sleep(2)

    @pytest.mark.run(order=2)
    @data(*getCSVData(
        "/Users/rade_dragosavac/PycharmProjects/framework/config_files/invalid_test_data.csv"
    ))
    @unpack
    def test_invalid_creating_event(self, event_name, event_title, celebrant,
                                    host, phone_number, event_date, rsvp_date):
        self.kindergifts.create_invalid_design(event_name, event_title,
                                               celebrant, host, phone_number,
                                               event_date, rsvp_date)
        self.kindergifts.check_error_messages()
        time.sleep(3)
        result1 = self.kindergifts.verify_invalid_event_failed()
        self.ts.mark_final("Test", result1, "Invalid event is not created")
예제 #2
0
class GitPageTests(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.login = LoginPage(self.driver)
        self.nr = ClickNewRepo(self.driver)
        self.cr = CreateNewRepo(self.driver)
        self.cn = CreateNewIssue(self.driver)
        self.tn = ToolbarNav(self.driver)

    @pytest.mark.run(order=1)
    @data(*getCSVData("testdata.csv"))
    @unpack
    def test_challange1(self, user_id, password):
        self.login.logins(userid=user_id, password=password)
        self.nr.clickNew()
        self.cr.createRepo()

    @pytest.mark.run(order=2)
    def test_challenge2(self):
        global TEXT
        self.tn.clickIssue()
        self.tn.clickIssueButton()
        self.cn.crtIssue(title="git_title" + str(random.randrange(1, 999878)),
                         desc="git_desc" + str(random.randrange(1, 987899)))
        TEXT = self.cn.getPreIssue()
        self.cn.clkIssue()
        self.cn.crtIssue(title=TEXT[:-3], desc=TEXT[:-3])

    @pytest.mark.run(order=3)
    def test_challenge3(self):
        self.cn.comment(data="Entering Comments")
        self.cn.sendEmoji()

    @pytest.mark.run(order=4)
    def test_challenge4(self):
        time.sleep(2)
        self.tn.clickIssue()
        self.cn.issueListclk()
        self.cn.comment(data=TEXT)
        self.cn.cmntListclk()

    @pytest.mark.run(order=5)
    @data(*getCSVData("testdata.csv"))
    @unpack
    def test_challenge5(self, user_id, password):
        self.cr.deleteRepo(password=password)
class loginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = TestStatus(self.driver)

    @pytest.mark.run(order=2)
    def test_validLogin(self):
        #not_link ='.//*[@id="nvpush_cross"]/svg'
        self.lp.login('9818152283', 'malik')
        result1 = self.lp.verifyTitle()
        self.ts.mark(result1, "")
        result2 = self.lp.verifyLoginSuccessful()
        self.ts.markFinal("test_validLogin", result2,
                          "Login was not successful")

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\sneha.malik\PycharmProjects\simpleframework\\test_data.csv"
    ))
    #@data(("9818152283","abc"),("9899059627","malik"))
    @unpack
    def test_invalidLogin(self, mobilenumber, password):
        self.lp.login(mobilenumber, password)
        result = self.lp.verifyLoginFailed()
        self.ts.markFinal("test_invalidLogin", result,
                          "Invalid password has been entered")
예제 #4
0
class LoginTests(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

    result_set = {}
    _username = "******"
    _password = "******"

    @pytest.fixture(autouse=True)
    def objectSetup(self, setUp):
        self.lp = LoginPage(self.driver)
        #self.ts = Status(self.driver)

    # print("print lp "+str(self.lp))
    i = 0

    @pytest.mark.run()
    @data(*getCSVData(
        "C:/Users/user/workspace/com.instasafev2/usource/usernamePassword.csv")
          )
    @unpack
    def test_t1invalidLogin(self, condition, username, password):
        self.i += 1
        self.log.info("*#" * 20)
        self.log.info("ID " + str(self.i) + " test_t1_Login with " +
                      condition + " credential where username is " + username +
                      " and password is " + password)
        self.log.info("*#" * 20)
        time.sleep(3)
        self.lp.multiple_login(condition, username, password)
예제 #5
0
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        time.sleep(3)
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData("D:\\workspace\\AutomationFramework\\testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        self.courses.clickOnSearchButton()
        res = self.courses.selectCourseToEnroll(courseName)
        self.ts.mark(res, "Search Course Verification")
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        # result = self.courses.verifyEnrollFailed()
        time.sleep(3)
        self.courses.clickOnIcon()
        self.ts.markFinal("test_invalidEnrollment", res,
                          "Enrollment Failed Verification")
예제 #6
0
class RequestFuelTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.so = CreateSalesOrderPage(self.driver)
        self.ts = Status(self.driver)
        self.db = DashboardPage(self.driver)

    def setUp(self):
        self.db.navigateHome()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/nhussein/PycharmProjects/Gportal/dashboard_testdata.csv"))
    @unpack
    def test_validate_dashboard_links_656(self, icao, airportName):

        #validate quick fuel query
        self.so.enterICAO(icao, airportName)
        #back to Dashboard/Home
        self.db.navigateHome()
        #click fuel orders today
        self.db.clickFuelOrdersToday()
        #validate orders
        self.db.validateOrdersUplift('today')
        '''result = self.so.verifySOcreated()
예제 #7
0
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData("testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV, country):
        self.courses.login()
        self.courses.enterCourseName(courseName)
        self.courses.selectCourseToEnroll(courseName)
        self.courses.enrollCourse(num=ccNum,
                                  exp=ccExp,
                                  cvv=ccCVV,
                                  country=country)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
        self.courses.logout()
예제 #8
0
class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = Status(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateHome()

    @pytest.mark.run(order=1)
    #@data(("JavaScript for beginners","4143202652384595","1220","101"),("Learn Python 3 from scratch","41426543764387900","1221","303"))
    #you can provide with only with the file name without the path since it is saved under the project
    @data(
        *getCSVData("/Users/nhussein/PycharmProjects/Letskodeit/testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCvv):
        self.courses.enterCourseName(courseName)
        self.courses.selectCourseToEnroll(courseName)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCvv)
        time.sleep(5)
        #result = self.courses.verifyCardDecline()
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #9
0
class iCARTTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.ts = TestStatus(self.driver)
        self.ip = IcartOrderPage(self.driver)

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/enriquealejandro.d/PycharmProjects/WKSelenium/testdataicart.csv"
    ))
    @unpack
    def test_icart(self, customerCSV, phoneCSV, emailCSV, targetNCSV,
                   ProductCSV, statevarCSV):
        self.ip.icartorder(customer=customerCSV,
                           phone=phoneCSV,
                           email=emailCSV,
                           targetN=targetNCSV,
                           selProduct=ProductCSV,
                           statev=statevarCSV)
        result2 = self.ip.verifyOrderConfirmation()
        result3 = self.ip.captureOrderNumber()
        self.ip.startNewOrder()
        self.ts.mark(result2, "Order Created: " + str(result3))
        self.ts.markFinal("test_sanity_iCART ", result2,
                          "Order was placed correctly")
예제 #10
0
class RegisterCoursesCSVDataTests(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetUp(self):
        self.course = RegisterCoursePage(self.driver)
        self.ts = TestStatus(self.driver)
        self.np = NavigationPage(self.driver)

    def setUp(self):
        self.np.navigateToAllCourses()
        # self.driver.find_element_by_link_text("All Courses").click()

    pytest.mark.run(order=1)
    # @data(("JavaScript for Beginners", "10", "1220", "10"), ("Selenium WebDriver with Java ", "12", "0923", "16"))
    @data(*getCSVData("testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.course.enterCourseName(courseName)
        time.sleep(1)
        self.course.selectCourseToEnroll(courseName)
        time.sleep(2)
        self.course.enrollCourse(num="ccNum", exp="ccExp", cvv="ccCVV")
        time.sleep(1)
        result = self.course.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result, "Test Enrollment Failed")
예제 #11
0
class RegisterCoursesCSVDataTests(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        r"C:\Users\Siddhant Bhatt\PycharmProjects\AutomationFramework\testdata.csv"
    ))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV,
                               postcode):
        """
        Tests for invalid enrollment by passing multiple wrong payment details using a csv file
        Uses TestStatus class to mark/assert test case results
        """
        self.log.info("*#" * 20)
        self.log.info("test_invalidEnrollment started")
        self.log.info("*#" * 20)
        self.courses.enterCourseName(courseName)
        self.courses.selectCourseToEnroll(courseName)
        self.courses.enrollCourse(num=ccNum,
                                  exp=ccExp,
                                  cvv=ccCVV,
                                  postcode=postcode)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
        self.driver.get("https://learn.letskodeit.com/")
예제 #12
0
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        #self.driver.find_element_by_link_text("All Courses").click()
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/atomar/Documents/workspace_python/letskodeit/testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(1)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(1)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TrackStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    # * is to unpack if tuples, lists etc are used in data
    # getCSVData was mentioned in import statement above so @data recognizes it
    # Use full path + filename
    @data(*getCSVData(
        "C:\\Users\\Eugene\\PycharmProjects\\AutomationFramework\\testdata.csv"
    ))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(1)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(1)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
        # ALTERNATE WAY TO GO BACK USING JS:py.
        # self.driver.execute_script("window.history.go(-1)")
        self.driver.back()
class RegisterCoursesCSVDataTests(unittest.TestCase):
    """
    

    To run html reports verify pytest-html is installed. If is not installed, from the terminal type : pip3 install pytest-html

    """
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver, self.cfg)
        self.ts = TstStatus(self.driver)
        self.nav = NavigationPage(self.driver, self.cfg)

    def setUp(self):
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData("testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV, ccZip):
        self.courses.enterCourseName(courseName)
        time.sleep(1)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV, zip=ccZip)
        time.sleep(1)
        result = self.courses.verifyEnrollFailed()
        self.driver.back()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #15
0
class NewCustomerTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.newCustomer = createNewCustomerPage(self.driver)
        self.sc = statusCheck(self.driver)

    @data(*getCSVData("C:\\Users\\GSingh\\PycharmProjects\\POM\\testdata.csv"))
    @unpack
    def test_create_Customer(self, companyname, address, city, state,
                             postalcode, phonenumber, users, guid, contactname,
                             contactemail):
        self.newCustomer.clickAdmin()
        self.newCustomer.clickCustomer()
        self.newCustomer.addNewCustomer()
        self.newCustomer.enterCompanyName(companyname)
        self.newCustomer.enterAddress(address)
        self.newCustomer.enterCity(city)
        self.newCustomer.selectCountry()
        self.newCustomer.enterState(state)
        self.newCustomer.enterPostalCode(postalcode)
        self.newCustomer.enterPhoneNumber(phonenumber)
        self.newCustomer.selectStartContractDate()
        self.newCustomer.selectEndContractDate()
        self.newCustomer.selectAccountType()
        self.newCustomer.enterUsers(users)
        self.newCustomer.enterSFGUID(guid)
        self.newCustomer.enterContactName(contactname)
        self.newCustomer.enterContactEmail(contactemail)
        self.newCustomer.clickSaveButton()
예제 #16
0
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.rc = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToHome()
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/K1/Documents/python_workspace/AutomationFramework/testdata.csv"
    ))
    @unpack
    def test_invalidEnrollment(self, courseName, courseCount):
        self.rc.enterCourseName(courseName, courseCount)
        time.sleep(1)
        self.rc.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.rc.clickEnrollButton()
        self.rc.clickBuyNowButton()
        time.sleep(1)
        result = self.rc.verifyEnrollmentFailed()
        self.ts.markFinal(testName="test_invalidEnrollment",
                          result=result,
                          resultMessage="verifyEnrollmentFailed")
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = ExecutionStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        #self.driver.find_element_by_link_text("All Courses").click()
        self.driver.find_element_by_xpath(
            "//a[@class='navbar-brand header-logo']//img").click()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\semc0\\Desktop\\letskodeit_200607\\testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(1)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(1)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #18
0
class ClickItemsCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.items = ClickItems(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        """
        after every test -> the web page will be navigate to practice page -> main page .
        :return:
        """
        self.nav.navigateToPracticePage()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\vadim\PycharmProjects\\automationPracticeStore.com\\datafile.csv"
    ))
    @unpack
    def test_click_on_item(self, item, amount):
        """
        using ddt and get the items from 'datafile.csv' file .
        :param item: the item the automation will be checking .
        :param amount: amount of time this item will be added to the cart .
        :return:
        """
        self.items.click_on_item(item=item)
        self.items.add_to_cart(amount=amount)
        result1 = self.items.verify_item_added_successfully(amount=amount)
        self.ts.mark(result1, "######### ITEM DID NOT ADDED SUCCESSFULLY .")
        self.ts.markFinal("##### ADD ITEM AND TOTAL PRICE TEST CHECK")
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToHome()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/marten.westman/PycharmProjects/webdriver_framework/testdata.csv"
    ))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV,
                               ccPostal):
        self.courses.enterCourseName(courseName)
        self.courses.selectCourseToEnroll(courseName)
        self.courses.enrollCourse(num=ccNum,
                                  exp=ccExp,
                                  cvv=ccCVV,
                                  zip=ccPostal)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #20
0
class RegisterCourseCSVTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = CheckStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToAllCourse()
        time.sleep(5)

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/dattran/Documents/Virtualenv/PyCharm/workspace_python/letskodeit/data.csv"
    ))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(2)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(2)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(5)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #21
0
class RegisterCoursesTests(unittest.TestCase):

    BASEDIR = os.path.dirname(
        os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
    TESTDATA_FILE_PATH = os.path.join(BASEDIR, 'test_data.csv')

    @pytest.fixture(autouse=True)
    def objectSetUp(self, oneTimeSetUp):
        if self.driver is None:
            assert False
        self.rcp = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.np = NavigationPage(self.driver)

    def setUp(self):
        self.rcp.webScroll("up")
        self.np.navigateToHome()

    @pytest.mark.run(order=1)
    @data(*getCSVData(TESTDATA_FILE_PATH))
    @unpack
    def test_enrollForCourse(self, courseName, cc_num, cc_exp, cc_cvv, country,
                             postal_code):
        self.rcp.selectCategoryAndAuthor("All", "All")
        self.rcp.enterCourseName(courseName)
        self.rcp.clickOnCourseName(courseName)
        self.rcp.enrollCourse(cc_num=cc_num,
                              cc_exp=cc_exp,
                              cc_cvv=cc_cvv,
                              country=country,
                              postal=postal_code)
        self.ts.markFinal("enrollForCourse", "Pass",
                          "Successfully enrolled for course")
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.course = RegisterCoursesPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        # self.driver.find_element_by_link_text("All Courses").click()
        # self.driver.find_element_by_xpath("//a[@class='navbar-brand header-logo']").click()
        # self.driver.get("https://learn.letskodeit.com/courses")
        self.nav.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(
        *getCSVData("C:\Users\Durga\workspace_python\myframework\testdata.csv")
    )
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(2)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(2)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(2)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
예제 #23
0
class HomeTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.hp = HomePage(self.driver)

    # @pytest.mark.run(order=1)
    # @data(("*****@*****.**", "amazonapps", "iphone 7"))
    # @unpack
    # def test_validLogin(self,email,password,search):
    #     self.lp.login(email, password)
    #     # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in
    #     title = self.lp.verifyTitle("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in")
    #     self.ts.mark(title, "Title mismatch!")
    #     result = self.lp.verifyLoginSuccessful()
    #     self.ts.markFinal("test_validLogin",result,"Login was not successful")
    #     self.hp.search(search)

    @pytest.mark.run(order=1)
    # * -- means mutiple args
    @data(*getCSVData(
        "/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv"))
    @unpack
    def test_validLogin(self, email, password, search):
        self.lp.login(email, password)
        # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in
        title = self.lp.verifyTitle(
            "Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in"
        )
        self.ts.mark(title, "Title mismatch!")
        result = self.lp.verifyLoginSuccessful()
        self.ts.markFinal("test_validLogin", result,
                          "Login was not successful")
        self.hp.search(search)
예제 #24
0
class AddressTests(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def classSetup(self):
        self.lp = LoginPage(self.driver)
        self.ts = TestStatus(self.driver)
        self.hp = HomePage(self.driver)
        self.ad = AddressPage(self.driver)

    # @pytest.mark.run(order=1)
    # # @data(*getCSVData("/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv"))
    # @data("*****@*****.**","auto2018","aravinda")
    # @unpack
    # def test_addAddress(self,email,password,fullname):
    #     self.lp.login(email, password)
    #     # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in
    #     # title = self.lp.verifyTitle("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in")
    #     # self.ts.mark(title, "Title mismatch!")
    #     # result = self.lp.verifyLoginSuccessful()
    #     # self.ts.markFinal("test_addAddress",result,"Login was not successful")
    #     self.ad.addNewAddress(fullname)

    @pytest.mark.run(order=1)
    # * -- means mutiple args
    @data(*getCSVData("/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv"))
    @unpack
    def test_addAddress(self,email,password,search):
        self.lp.login(email, password)
        # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in

        self.hp.search(search)
예제 #25
0
class ProductButtonCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.product = ProductButtonsCheck(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        """
        naviage to practice page after every test .
        :return:
        """
        self.nav.navigateToPracticePage()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\vadim\PycharmProjects\\automationPracticeStore.com\\option.csv"
    ))
    @unpack
    def test_product_tag_sofa(self, option):
        self.product.check_tag(option)
        result = self.product.check_elements_text(option)
        self.ts.mark(
            result,
            "######### PRODUCT {} TEST DID NOT PASSED .".format(option))
        self.ts.markFinal("######## PRODUCT {} TEST .".format(option))
예제 #26
0
class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = StatusTTest(self.driver)
        self.nav = Navigation_page(self.driver)

    def setUp(self):
        self.nav.navigateToPractice()
        time.sleep(2)
        self.nav.navigateToALlCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData("/Users/jobster/Documents/LetsKodeIt/testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, CourseName, ccNum, ccEXP, ccCVV, ccZIP):
        self.courses.EnterCourseName(CourseName)
        time.sleep(1)
        print("**" * 20)
        print("***")
        lp = CourseName
        print(lp)
        print("***")
        print("**" * 20)

        self.courses.SelectCourseToEnroll(CourseName)
        self.courses.EnrollCourse(num=ccNum, exp=ccEXP, cvv=ccCVV, zip=ccZIP)
        result = self.courses.verifyEnrollFailed()
        self.driver.get("https://letskodeit.teachable.com/courses")
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
class SmokeTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = TestStatus(self.driver)
        #self.np = NavigationPage(self.driver)
        self.re = RegisterAgentPage(self.driver)

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "/Users/enriquealejandro.d/PycharmProjects/WKSelenium/testdata.csv"))
    @unpack
    def test_valid(self, user, password, domesticCSV, countyCSV, companyCSV,
                   ccvCSV):
        self.lp.login(user, password)
        self.re.registerAgent(domestic=domesticCSV,
                              county=countyCSV,
                              companyname=companyCSV,
                              cvv=ccvCSV)
        result2 = self.re.verifyOrderConfirmation()
        result3 = self.re.captureOrderNumber()
        self.re.logoutMyCT()
        self.ts.mark(result2, "Order Created" + str(result3))
        self.ts.markFinal("test_sanity_registeredAgent", result2,
                          "Order was placed correctly")
class AddMultiplePersonCSVDataTests(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        """
        Class object(s) setup
        """
        self.pp = PersonPage(self.driver)
        self.ts = TestStatus(self.driver)

    @pytest.mark.run()
    @data(*getCSVData(r"C:\Users\Siddhant Bhatt\PycharmProjects\GTS\tests\testdata.csv"))
    @unpack
    def test_addMultiplePerson(self, firstName, lastName):
        """
        Tests for adding multiple person record using csv file and verifies its presence in the person list
        Uses TestStatus class to mark/assert test case results
        """
        self.log.info("*#" * 20)
        self.log.info("test_addMultiplePerson started")
        self.log.info("*#" * 20)
        self.pp.addPerson(firstName=firstName, lastName=lastName)
        result = self.pp.verifyPersonRecord(firstName=firstName, lastName=lastName)
        self.ts.markFinal(testName="test_addPerson", result=result, resultMessage="Verify Add Person")
        self.driver.get("https://logisticsmarts.net/")
예제 #29
0
 def well_pagination_limit_not_exceed_setup(self):
     rows = getCSVData('tests/testdata/pagination/wellpaginationexceed.csv')
     table_entries = 0
     for row in rows:
         if table_entries < globalconfig.pagination_limit:
             self.client.insert_well(row[0], row[1])
             table_entries += 1
     self.wellpage.page_refresh()
예제 #30
0
class SmokeTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.up = UsersPage(self.driver)
        self.ts = StatusTest(self.driver)
        self.nav = NavigationPage(self.driver)
        self.lp = LoginPage(self.driver)

    @pytest.mark.first
    @data(*getCSVData("/home/sergey/station/data/admilogindata.csv"))
    @unpack
    def test_admin_login(self, admEmail, admPassword):
        self.lp.logout()
        self.lp.login(email=admEmail, password=admPassword)
        result = self.lp.verifyAdmLogin()
        assert result == True
        self.ts.mark(result, "TEST PASSED")


    def setUp(self):
        self.nav.openUserPage()

    @pytest.mark.order1
    @data(*getCSVData("/home/sergey/station/data/addusersdata.csv"))
    @unpack
    def test_add_users(self, uemail, uphone, uname, upassword, upasswordConfirm, urole):
        _old_users = self.up.getNumOfAutoTestUsers()
        self.up.addUser(email=uemail, phone=uphone, name=uname, password=upassword,
                            passwordConfirm=upasswordConfirm, role=urole)
        _new_users = self.up.getNumOfAutoTestUsers()
        assert _new_users == _old_users + 1
        self.ts.mark("True", "TEST PASSED")

    @data(*getCSVData(""))
    @unpack
    def test_mail_check(sefl, ):


    @pytest.mark.last
    def test_delete_auto_users(self):
        self.up.deleteAutoTestUsers()
        _new_users = self.up.getNumOfAutoTestUsers()
        assert _new_users == 0
        self.ts.markFinal("SmokeTest", "TRUE", "ALL TESTS PASSED SECCESFUL")