Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 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
1dc8a72
add allure-docker-service in project
vladislav094 Jul 24, 2022
98bb1bf
Delete allure-reports directory
vladislav094 Jul 24, 2022
d1a4cec
add allure-docker-service in project
vladislav094 Jul 24, 2022
52ef72d
Merge branch 'allure-docker-service' of github.com:vladislav094/pytho…
vladislav094 Jul 24, 2022
89fc487
add allure-docker-service in project
vladislav094 Jul 24, 2022
02f8f89
add allure-docker-service in project
vladislav094 Jul 24, 2022
f2eecc5
add allure-docker-service in project
vladislav094 Jul 24, 2022
6a2dfde
add allure-docker-service in project
vladislav094 Jul 24, 2022
ccbe43a
edit docker/jenkins files
vladislav094 Jul 25, 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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ screenshots/
*.pyc
geckodriver.log
.vscode/settings.json
/allure-results/
allure-reports
allure-results

.DS_Store
.AppleDouble

/framework/practice.py
.pytest_cache
tests/.pytest_cache
tests/negative_tests/.pytest_cache
tests/positive_tests/.pytest_cache

5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ RUN pip install "poetry==$POETRY_VERSION"

# Copy the poetry files to speed up builds.
WORKDIR /code
COPY poetry.lock pyproject.toml ./
COPY poetry.lock pyproject.toml docker-compose.yml ./

# Install dependencies via Poetry.
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

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

31 changes: 20 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
pipeline {

agent any

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

stages {
stage("create docker image") {
steps {
echo "========== start building image =========="
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 build -t web_test ."
sh "docker run -e RUN_HEADLESS=True --name example1 web_test pytest -s tests/negative_tests/test_authorization_user_negative.py"
sh "docker cp example1:/code/allure-results/ ${WORKSPACE}/"
sh "docker rm example1"
echo "========== finish building image =========="
}
}
stage('reports') {
steps {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'allure-results']]
])
}
}
}

}
}

21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'

services:
allure:
image: "frankescobar/allure-docker-service"
environment:
CHECK_RESULTS_EVERY_SECONDS: 1
KEEP_HISTORY: 1
ports:
- "5050:5050"
volumes:
- ${PWD}/allure-results:/app/allure-results
- ${PWD}/allure-reports:/app/default-reports

allure-ui:
image: "frankescobar/allure-docker-service-ui"
environment:
ALLURE_DOCKER_PUBLIC_API_URL: "http://localhost:5050"
ALLURE_DOCKER_PUBLIC_API_URL_PREFIX: ""
ports:
- "5252:5252"
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'

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
9 changes: 3 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ loguru = "^0.6.0"
Faker = "^13.15.0"
pytest-rerunfailures = "^10.2"


[tool.poetry.dev-dependencies]

[build-system]
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=5 --alluredir=allure-results/


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()