Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
1.4 kB
3
Indexable
import unittest
from selenium import webdriver
from pages.home_page import HomePage
from pages.careers_page import CareersPage
import time


class TestInsiderCareers(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.implicitly_wait(5)

    def test_careers_page(self):
        home_page = HomePage(self.driver)
        home_page.accept_cookies()
        print()
        print("Cookies accepted.")
        home_page.navigate_to_careers()

        careers_page = CareersPage(self.driver)
        self.assertTrue(careers_page.verify_sections(), "Not all sections are visible")

        careers_page.click_see_all_teams()
        print("Clicked 'See all teams' link.")
        careers_page.click_qa_page()
        print("You are in Quality Assurance page.")
        careers_page.click_see_all_qa_jobs()
        careers_page.select_istanbul_turkey()

        def tearDown(self):
            if hasattr(self, 'driver'):
                if self._outcome.errors[1][1]:
                    timestamp = time.strftime("%Y%m%d-%H%M%S")
                    screenshot_filename = f"screenshot_{timestamp}.png"
                    self.driver.save_screenshot(screenshot_filename)
                    print(f"Screenshot saved as {screenshot_filename}")
                self.driver.quit()


if __name__ == "__main__":
    unittest.main()
Leave a Comment