Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
689995c
added new branch and edit Jenkinsfile
vladislav094 Jul 18, 2022
c511b3c
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
9dd49c5
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
81c089d
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
c828e5b
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
a38da7a
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
2a108b0
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
a4313fb
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
d92ee62
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
8e25bf9
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
85c727d
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
6d509aa
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
9e4ef21
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
6502207
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
e7bf55e
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
60486f1
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
4f9e70f
edit pipeline, added allure dir
vladislav094 Jul 18, 2022
c659e43
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
9ffba92
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
8d78377
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
598cbb6
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
0c5c555
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
e699b4a
edit pipeline, added allure dir
vladislav094 Jul 19, 2022
56200d8
edit pipeline
vladislav094 Jul 19, 2022
02dc387
edit Jenkinsfile
vladislav094 Jul 19, 2022
57acf3f
edit Jenkinsfile
vladislav094 Jul 19, 2022
bef3c2d
edit Jenkinsfile
vladislav094 Jul 19, 2022
8b18074
edit Jenkinsfile
vladislav094 Jul 19, 2022
ccdc9ae
edit Jenkinsfile
vladislav094 Jul 19, 2022
32be2d0
edit Jenkinsfile
vladislav094 Jul 19, 2022
9a873b8
edit Jenkinsfile
vladislav094 Jul 19, 2022
948377f
edit pipeline
vladislav094 Jul 20, 2022
d7683ad
edit dockile and jenksfile
vladislav094 Jul 20, 2022
68d568f
Revert "edit dockile and jenksfile"
vladislav094 Jul 20, 2022
de5c981
add pipeline
vladislav094 Jul 21, 2022
16ec264
add pipeline
vladislav094 Jul 21, 2022
2f6e7ad
add pipeline
vladislav094 Jul 21, 2022
ffbd828
add pipeline
vladislav094 Jul 21, 2022
2b69217
add pipeline
vladislav094 Jul 21, 2022
66c24a9
add pipeline
vladislav094 Jul 21, 2022
e469672
add pipeline
vladislav094 Jul 21, 2022
a7dc09a
add pipeline
vladislav094 Jul 21, 2022
3176147
add pipeline
vladislav094 Jul 21, 2022
2c256d8
add pipeline
vladislav094 Jul 21, 2022
ca30727
add pipeline
vladislav094 Jul 21, 2022
9c1c2f1
add pipeline
vladislav094 Jul 21, 2022
fe4eb89
add pipeline
vladislav094 Jul 21, 2022
d7dc7bb
add pipeline
vladislav094 Jul 21, 2022
bb84b1a
add pipeline
vladislav094 Jul 21, 2022
efccdd2
add pipeline
vladislav094 Jul 21, 2022
2a231ee
add pipeline
vladislav094 Jul 21, 2022
dbf951a
add pipeline
vladislav094 Jul 21, 2022
0e0349c
add pipeline
vladislav094 Jul 21, 2022
13878b3
add pipeline
vladislav094 Jul 21, 2022
c6e6ab2
add pipeline
vladislav094 Jul 21, 2022
44596ca
Delete allure-report directory
vladislav094 Jul 21, 2022
93843a5
Delete allure-results directory
vladislav094 Jul 21, 2022
bd00788
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
934ab88
Merge branch 'allure-report' of github.com:vladislav094/python-ui-fra…
vladislav094 Jul 21, 2022
7ad6990
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
1b66933
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
f7a0ad7
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
3d22bc1
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
5c1426c
edit dockerfile, pipeline
vladislav094 Jul 21, 2022
d054e4d
add
vladislav094 Jul 21, 2022
6e195a3
add
vladislav094 Jul 21, 2022
a57053f
edit pipeline
vladislav094 Jul 25, 2022
0f01f10
edit pipeline
vladislav094 Jul 25, 2022
99aaf27
edit pipeline
vladislav094 Jul 25, 2022
9585755
edit pipeline
vladislav094 Jul 25, 2022
cbee23d
edit pipeline
vladislav094 Jul 25, 2022
a3f56ec
edit pipeline
vladislav094 Jul 25, 2022
a2500ed
edit pipeline
vladislav094 Jul 25, 2022
cbf9197
edit pipeline
vladislav094 Jul 26, 2022
92d38ef
edit pipeline
vladislav094 Jul 26, 2022
934822c
edit pipeline
vladislav094 Jul 26, 2022
c787b38
edit pipeline
vladislav094 Jul 26, 2022
b71f90b
edit pipeline
vladislav094 Jul 26, 2022
85713f2
Update README.md
vladislav094 Aug 2, 2022
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ screenshots/
*.pyc
geckodriver.log
.vscode/settings.json
/allure-results/
allure-reports
allure-results

.DS_Store
.AppleDouble

/framework/practice.py


2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

# Copy the source code into the image.
RUN mkdir allure-report
COPY framework ./framework
COPY tests ./tests
COPY pytest.ini ./

41 changes: 32 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
pipeline {

agent any

environment {
HEADLESS = '-e RUN_HEADLESS=True'
RUN_HEADLESS = 'True'
HEADLESS = '-e RUN_HEADLESS=True'
}

stages {
stage("create docker image") {
steps {
catchError{
echo "========== start building image =========="
sh "env"
// sh "docker rm example1"
sh "docker build -t web_test ."
// sh "env"
// sh "docker run --rm $HEADLESS web_test pytest"
sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/negative_tests/test_authorization_user_negative.py"
sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_making_orders_positive.py"
sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_search_module_operation.py"
sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_registration_and_authorization_positive.py"
sh "docker run \
-e RUN_HEADLESS=True \
--name example1 \
--rm \
--volume ${WORKSPACE}/allure-results/:/code/allure-results/ \
web_test \
pytest tests/negative_tests/test_general_checks.py::TestGeneralChecks::test_check_wrong_title_of_the_page"

// web_test pytest -s tests/negative_tests/test_authorization_user_negative.py
// sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_making_orders_positive.py"
// sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_search_module_operation.py"
// sh "docker run --rm -e RUN_HEADLESS=True web_test pytest -s tests/positive_tests/test_registration_and_authorization_positive.py"
echo "========== finish building image =========="
}
}
}
stage('reports') {
steps {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'allure-results']]
])
}
}
}

}
}

Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ class DataUserForRegistration:
EMAIL_ADDRESS_WITHOUT_DOMAIN = 'email_without_domain@'
EMAIL_ADDRESS_WITHOUT_AT = 'email_without_atgmail.com'
EMAIL_ADDRESS_WITHOUT_DOT = 'email_without_dot@gmailcom'
EMAIL_ADDRESS_WITH_SPEC_CHARACTER = 'email_with_t№$@gmailcom'
EMAIL_ADDRESS_WITH_SPEC_CHARACTER = 'email_with_spec_chraracter_№$@gmailcom'

4 changes: 4 additions & 0 deletions framework/features/automationpractice/main_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def check_title_order_page(self):
title = self.element.selenium.get_title_page()
assert title == "Order - My Store"

def check_title_main_page_wrong(self):
title = self.element.selenium.get_title_page()
assert title == "My Store1"

def fill_search_field_and_assert_result(self):
search_field = self.element.search_field.find_if_visible()
self.element.selenium.input(search_field, self.data_product.PRODUCT_WITH_NAME_BLOUSE)
Expand Down
2 changes: 0 additions & 2 deletions framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from selenium.webdriver.support.select import Select




class SeleniumBase:
def __init__(self, driver, locator=None):
self.driver = driver
Expand Down
3 changes: 2 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[pytest]
addopts = -v --reruns=5
addopts =-v --reruns=1 --alluredir=allure-results/


2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Installing and running a test framework on a local machine
## Installing and running the test framework locally
### Via Jenkins (local)
The developer of this framework expects that Jenkins (CI) is installed and configured on your local machine
#### To run a project inside Jenkins, you need:
Expand Down
30 changes: 16 additions & 14 deletions tests/negative_tests/test_authorization_user_negative.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

import allure
import pytest
from framework.features.automationpractice.automationpractice_app import AutomationpracticeApp
from framework.features.automationpractice.data.data_user_for_registration import DataUserForRegistration

@pytest.mark.usefixtures("set_up_webdriver")
class TestAuthorizationRegistrationNegative:
@allure.description("In that test we try login with invalid credentials")
@allure.severity(severity_level="CRITICAL")
def test_authorization_with_invalid_credentials_negative(self):
automation_practice = AutomationpracticeApp(self.driver)
sign_in = automation_practice.sign_in_page
Expand All @@ -13,18 +15,18 @@ def test_authorization_with_invalid_credentials_negative(self):
sign_in.assert_authentication_failed()



@pytest.mark.parametrize('email', [
DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_DOMAIN,
DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_AT,
DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_DOT,
DataUserForRegistration.EMAIL_ADDRESS_WITH_SPEC_CHARACTER
])
def test_registration_with_invalid_data_in_email_address_negative(self,email):
automation_practice = AutomationpracticeApp(self.driver)
sign_in = automation_practice.sign_in_page
automation_practice.go_to("index.php?controller=authentication&back=my-account")
sign_in.registration_with_invalid_email(email)
sign_in.assert_invalid_email_address()
# @allure.description("In that test we try to registration with invalid data in email address")
# @pytest.mark.parametrize('email', [
# DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_DOMAIN,
# DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_AT,
# DataUserForRegistration.EMAIL_ADDRESS_WITHOUT_DOT,
# DataUserForRegistration.EMAIL_ADDRESS_WITH_SPEC_CHARACTER
# ])
# def test_registration_with_invalid_data_in_email_address_negative(self,email):
# automation_practice = AutomationpracticeApp(self.driver)
# sign_in = automation_practice.sign_in_page
# automation_practice.go_to("index.php?controller=authentication&back=my-account")
# sign_in.registration_with_invalid_email(email)
# sign_in.assert_invalid_email_address()


16 changes: 16 additions & 0 deletions tests/negative_tests/test_general_checks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import allure
import pytest
from framework.features.automationpractice.automationpractice_app import AutomationpracticeApp

@pytest.mark.usefixtures("set_up_webdriver")
class TestGeneralChecks:
@allure.description("In that test we try assert wrong title main page")
@allure.severity(severity_level="MINOR")
def test_check_wrong_title_of_the_page(self):
automation_practice = AutomationpracticeApp(self.driver)
main_page = automation_practice.main_page
automation_practice.go_to("index.php")
main_page.check_title_main_page_wrong()