Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/Daily-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name: Test-All-Daily
on:
workflow_dispatch


permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # Обновлено с v3 до v4

- name: Set up Python 3.12
uses: actions/setup-python@v3
uses: actions/setup-python@v5 # Обновлено с v3 до v5
with:
python-version: "3.12"

Expand Down Expand Up @@ -45,7 +44,6 @@ jobs:
pytest -s -v --alluredir=allure-results
continue-on-error: true


- name: Add allure information
working-directory: allure-results
if: always()
Expand All @@ -67,7 +65,7 @@ jobs:
continue-on-error: true

- name: Allure Report action
uses: simple-elf/allure-report-action@v1.6
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: allure-results
Expand All @@ -77,23 +75,23 @@ jobs:

- name: Commit Allure report
if: always()
uses: peaceiris/actions-gh-pages@v2
uses: peaceiris/actions-gh-pages@v4 # Обновлено с v2 до v4
env:
PERSONAL_TOKEN: ${{ secrets.CI_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
continue-on-error: true


messsage:
message: # Исправлено: было messsage (опечатка)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Send message to Telegram
uses: "appleboy/telegram-action@master"
uses: appleboy/telegram-action@master
with:
to: ${{secrets.CHAT_ID}}
token: ${{secrets.TELEGRAM_TOKEN}}
to: ${{ secrets.CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: Daily full report https://brain-up.github.io/auto-tests-python/
continue-on-error: true

21 changes: 9 additions & 12 deletions .github/workflows/pull_request_report.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: Test-pull_requests

on:
push:
push:
# workflow_dispatch
# schedule:
# - cron: '0 0 * * *'


permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # Обновлено с v3 до v4

- name: Set up Python 3.12
uses: actions/setup-python@v3
uses: actions/setup-python@v5 # Обновлено с v3 до v5
with:
python-version: "3.12"

Expand Down Expand Up @@ -48,7 +47,6 @@ jobs:
pytest -s -v --alluredir=allure-results
continue-on-error: true


- name: Add allure information
working-directory: allure-results
if: always()
Expand All @@ -70,7 +68,7 @@ jobs:
continue-on-error: true

- name: Allure Report action
uses: simple-elf/allure-report-action@v1.6
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: allure-results
Expand All @@ -80,23 +78,22 @@ jobs:

- name: Commit Allure report
if: always()
uses: peaceiris/actions-gh-pages@v2
uses: peaceiris/actions-gh-pages@v4 # Обновлено с v2 до v4
env:
PERSONAL_TOKEN: ${{ secrets.CI_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
continue-on-error: true


messsage:
message: # Исправлено: было messsage (опечатка)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Send message to Telegram
uses: "appleboy/telegram-action@master"
uses: appleboy/telegram-action@master
with:
to: ${{secrets.CHAT_ID}}
token: ${{secrets.TELEGRAM_TOKEN}}
to: ${{ secrets.CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: Last pull request report https://brain-up.github.io/auto-tests-python/
continue-on-error: true
37 changes: 33 additions & 4 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,50 @@ def click_on_links_on_ru_local(self):
@allure.step("Click on links on the 'en' local and thereby open corresponding web pages in the same tab")
def click_on_links_on_en_local(self):
opened_pages = []
starting_url = self.driver.current_url
print(starting_url)

link1 = self.element_is_present_and_clickable(self.locators.PAGE_LINK1)
current_url = self.driver.current_url
link1.click()
Wait(self.driver, 10).until(EC.url_changes(current_url))

# Waiting for the first URL change (intermediate page)
Wait(self.driver, 10).until(EC.url_changes(starting_url))
intermediate_url = self.driver.current_url
print(intermediate_url)

# Waiting for the second URL change (aimed page)
Wait(self.driver, 10).until(EC.url_changes(intermediate_url))
current_url = self.driver.current_url
print(current_url)

opened_pages.append(self.get_current_tab_url())

self.driver.back()
intermediate_url = self.driver.current_url
print(intermediate_url)

self.driver.back()
starting_url = self.driver.current_url
print(starting_url)

# Waiting for the starting page loading
Wait(self.driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, "h3")))

link2 = self.element_is_present_and_clickable(self.locators.PAGE_LINK2)
current_url = self.driver.current_url
link2.click()
Wait(self.driver, 10).until(EC.url_changes(current_url))

# Waiting for the first URL change (intermediate page)
Wait(self.driver, 10).until(EC.url_changes(starting_url))
intermediate_url = self.driver.current_url
print(intermediate_url)

# Waiting for the second URL change (aimed page)
Wait(self.driver, 10).until(EC.url_changes(intermediate_url))
current_url = self.driver.current_url
print(current_url)

opened_pages.append(self.get_current_tab_url())
print(opened_pages)

return opened_pages

Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def auto_test_user_authorized(driver, main_page_open):
page.element_is_visible(LoginPageLocators.INPUT_PASSWORD).send_keys(os.environ["PASSWORD"])
page.element_is_present_and_clickable(LoginPageLocators.SIGN_IN_BUTTON).click()
page.check_expected_link(MainPageLinks.URL_GROUPS_PAGE)
print("Current URL:", driver.current_url) # Temporarily for debugging
page = ProfilePage(driver)
page.loader_checking()

Expand Down
Loading