Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fengchenfcpp committed Sep 30, 2024
2 parents a38cbd4 + 89230d2 commit 10619c8
Show file tree
Hide file tree
Showing 111 changed files with 725 additions and 0 deletions.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
15 changes: 15 additions & 0 deletions CartonPython/lesson2/hello1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/python
# Filename : ch02/hello1.py

import world1
from world1 import z
from world1 import x as x2

x = 100
y = 20

print (world1.x)
print (y)
print (z)
print (x2)
print (x)
6 changes: 6 additions & 0 deletions CartonPython/lesson2/world1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# coding=utf-8
# Filename : ch02/world1.py

x = '你好'
y = True
z = 20.0
14 changes: 14 additions & 0 deletions CartonPython/lesson3/ch_3_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/python
# Filename : ch_3_2.py

x = 28
print (type(x))

y = '你好'
print (type(y))

z = True
print (type(z))

i = 3.14159265354
print (type(i))
12 changes: 12 additions & 0 deletions CartonPython/lesson5/ch5_2_1_2_snow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# Filename: ch5_2_1_2_snow.py

i = 0

while i * i < 100099:
i += 1
if i == 55:
break
print(str(i) + '*' + str(i) + ' =', i * i)
else:
print('While Over')
11 changes: 11 additions & 0 deletions CartonPython/lesson5/ch5_2_2_1_snow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding=utf-8
# Filename: ch5_2_2_1_snow.py

print("------字符串--------")
for item in '我是你爸爸':
print(item)

numbers = [54188 ]
print("---------整数列表---------")
for item in numbers:
print(item)
7 changes: 7 additions & 0 deletions CartonPython/lesson5/ch5_2_2_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8
# Filename: ch5_2_2_2.py

for item in range(10):
print(item)
else:
print('For Over')
9 changes: 9 additions & 0 deletions CartonPython/lesson5/ch5_2_2_2_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# Filename: ch5_2_2_2_1.py

for item in range(10):
print(item)
if item ==30:
break
else:
print('For Over')
7 changes: 7 additions & 0 deletions CartonPython/lesson5/ch5_3_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8
# Filename: ch5_3_1.py

for item in range(10):
if item == 3:
break
print(item)
7 changes: 7 additions & 0 deletions CartonPython/lesson5/ch5_3_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8
# Filename: ch5_3_2.py

for item in range(10):
if item == 2 or item == 4 or item == 6 or item == 8:
continue
print(item)
13 changes: 13 additions & 0 deletions CartonPython/lesson5/ch5_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# Filename: ch5_3_2.py

i = 100; r = 0; s = 0; t = 0

while i < 1000:
r = i // 100
s = (i - r * 100) // 10
t = i - r * 100 - s * 10
if i == (r ** 3 + s ** 3 + t ** 3):
print("i = " + str(i))

i += 1
Binary file not shown.
Binary file not shown.
Binary file not shown.
186 changes: 186 additions & 0 deletions Elegant Automation Frameworks with Python and Pytest/assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}

h1 {
font-size: 24px;
color: black;
}

h2 {
font-size: 16px;
color: black;
}

p {
color: black;
}

a {
color: #999;
}

table {
border-collapse: collapse;
}

/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}

/******************************
* TEST RESULT COLORS
******************************/
span.passed,
.passed .col-result {
color: green;
}

span.skipped,
span.xfailed,
span.rerun,
.skipped .col-result,
.xfailed .col-result,
.rerun .col-result {
color: orange;
}

span.error,
span.failed,
span.xpassed,
.error .col-result,
.failed .col-result,
.xpassed .col-result {
color: red;
}

/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%;
}
#results-table th,
#results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left;
}
#results-table th {
font-weight: bold;
}

/*------------------
* 2. Extra
*------------------*/
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap;
}
.log:only-child {
height: inherit;
}

div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.image img {
width: 320px;
}

div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}

.collapsed {
display: none;
}

.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}

.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}

/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}

.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
10 changes: 10 additions & 0 deletions Elegant Automation Frameworks with Python and Pytest/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pytest import fixture
from selenium import webdriver

@fixture(scope='function')
def chrome_browser():
browser = webdriver.Chrome()
yield browser

# Teardown
print("I am tearing down this browser")
12 changes: 12 additions & 0 deletions Elegant Automation Frameworks with Python and Pytest/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# pytest.ini
[pytest]
python_files = test_*
python_classes = *Tests
python_functions = test_*

markers =
smoke: marks tests as smoke (deselect with '-m "not smoke"')
body: marks tests as body (deselect with '-m "not body"')
engine: marks tests as engine (deselect with '-m "not engine"')
entertainment: marks tests as entertainment (deselect with '-m "not entertainment"')
ui: marks tests as ui (deselect with '-m "not ui"')
Loading

0 comments on commit 10619c8

Please sign in to comment.