Skip to content

Commit 2d7bc87

Browse files
Davide Morodavidemoro
authored andcommitted
get rid of basic settings
1 parent 1acd360 commit 2d7bc87

File tree

7 files changed

+2
-92
lines changed

7 files changed

+2
-92
lines changed

README.rst

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ and bake your new QA package providing some information::
2929

3030
$ pip install cookiecutter
3131
$ cookiecutter https://github.com/tierratelematics/cookiecutter-qa
32-
advanced [y]:
3332
full_name [Davide Moro]:
3433
3534
github_username [tierratelematics]:
@@ -56,35 +55,13 @@ and bake your new QA package providing some information::
5655
testrail [y]:
5756
$ cd project_qa
5857

59-
As result cookiecutter will create for you a new package.
58+
As result cookiecutter will create for you a new package with a hello world test pytest_, Splinter_, BDD and page
59+
objects ready.
6060

6161
**Important note**: be aware that the Browserstack access key will be saved in ``project_name/Dockerfile``
6262
so keep in mind that before distributing your project!
6363

6464

65-
Advanced (y)
66-
------------
67-
68-
If you respond ``advanced: y`` you get an opinionated stack with a hello world test pytest_, Splinter_, BDD and page objects ready.
69-
70-
71-
Advanced (n)
72-
------------
73-
If you respond ``advanced: n`` you get a basic project with a basic hello world based on Selenium Splinter.
74-
75-
You can see the ``test_basic.py`` contents::
76-
77-
$ cat project_qa/project_qa/tests/functional/test_basic.py
78-
79-
80-
def test_basic(browser, base_url):
81-
browser.visit(base_url)
82-
assert 'http://www.tierratelematics.com' in browser.url
83-
84-
This is what you need if you want to familiarize with pytest_, Splinter_ API or if you want create your own setup
85-
that fits your needs.
86-
87-
8865
How to use it
8966
=============
9067

cookiecutter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"advanced": "y",
32
"full_name": "Davide Moro",
43
"email": "[email protected]",
54
"github_username": "tierratelematics",

docs/prompts.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ Templated Values
88

99
The following appear in various parts of your generated project.
1010

11-
advanced
12-
``n`` if you want a very simple hello world test, ``y`` for an opinionated setup with BDD, page objects
13-
1411
full_name
1512
Your full name.
1613

hooks/post_gen_project.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,3 @@ def remove_folder(*folderpath):
2626

2727
if '{{ cookiecutter.testrail }}' == 'n':
2828
remove_file('testrail.cfg')
29-
30-
if '{{ cookiecutter.advanced }}' == 'n':
31-
remove_folder('{{cookiecutter.project_slug}}', 'pages')
32-
remove_folder('{{cookiecutter.project_slug}}', 'features')
33-
remove_file('{{cookiecutter.project_slug}}', 'config.py')
34-
remove_file('{{cookiecutter.project_slug}}', 'cli.py')
35-
remove_file('{{cookiecutter.project_slug}}', 'tests',
36-
'functional', 'test_login.py')
37-
remove_file('{{cookiecutter.project_slug}}', 'tests',
38-
'functional', 'test_logout.py')
39-
remove_file('{{cookiecutter.project_slug}}', 'tests',
40-
'functional', 'conftest.py')

tests/test_bake_project.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -162,42 +162,6 @@ def test_bake_and_run_tests(cookies, default_extra_context):
162162
print("test_bake_and_run_tests path", str(result.project))
163163

164164

165-
def test_bake_withspecialchars_and_run_tests(cookies, default_extra_context):
166-
"""Ensure that a `full_name` with double quotes does not break setup.py"""
167-
extra_context = default_extra_context.copy()
168-
extra_context['full_name'] = 'name "quote" name'
169-
with bake_in_temp_dir(cookies, extra_context=extra_context) as result:
170-
assert result.project.isdir()
171-
run_inside_dir(
172-
'make docker-run BROWSERSTACK_ACCESS_KEY={0}'.format(
173-
default_extra_context['browserstack_access_key']),
174-
str(result.project)) == 0
175-
176-
177-
def test_bake_with_apostrophe_and_run_tests(cookies, default_extra_context):
178-
"""Ensure that a `full_name` with apostrophes does not break setup.py"""
179-
extra_context = default_extra_context.copy()
180-
extra_context['full_name'] = "O'connor"
181-
with bake_in_temp_dir(cookies, extra_context=extra_context) as result:
182-
assert result.project.isdir()
183-
run_inside_dir(
184-
'make docker-run BROWSERSTACK_ACCESS_KEY={0}'.format(
185-
default_extra_context['browserstack_access_key']),
186-
str(result.project)) == 0
187-
188-
189-
def test_bake_with_basic_and_run_tests(cookies, default_extra_context):
190-
"""Ensure that an advanced n doesn't break things"""
191-
extra_context = default_extra_context.copy()
192-
extra_context['advanced'] = "n"
193-
with bake_in_temp_dir(cookies, extra_context=extra_context) as result:
194-
assert result.project.isdir()
195-
run_inside_dir(
196-
'make docker-run BROWSERSTACK_ACCESS_KEY={0}'.format(
197-
default_extra_context['browserstack_access_key']),
198-
str(result.project)) == 0
199-
200-
201165
def test_bake_with_no_testrail_and_run_tests(cookies, default_extra_context):
202166
"""Ensure that an without testrail doesn't break things"""
203167
extra_context = default_extra_context.copy()

{{cookiecutter.project_slug}}/setup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44

55

66
install_requires = [
7-
{%- if cookiecutter.advanced == 'y' %}
87
'pytest-pypom-navigation',
98
'colander',
109
'pytest-variables[yaml]',
1110
'pytest-bdd',
1211
'pytest-splinter',
1312
'pypom_form',
14-
{% else %}
15-
'pytest-selenium',
16-
{%- endif %}
1713
{%- if cookiecutter.testrail == 'y' %}
1814
'pytest-testrail',
1915
{%- endif %}

{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/tests/conftest.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{%- if cookiecutter.advanced == 'y' %}
21
"""
32
Fixture Diagrams
43
----------------
@@ -99,16 +98,6 @@ def page_mappings():
9998
:rtype: dict`
10099
"""
101100
return {{cookiecutter.project_slug}}.config.PAGE_MAPPINGS
102-
{%- else %}
103-
import os
104-
import pytest
105-
import {{cookiecutter.project_slug}}
106-
107-
108-
@pytest.fixture(scope='session')
109-
def base_url():
110-
return "{{cookiecutter.base_url}}"
111-
{%- endif %}
112101

113102

114103
@pytest.fixture(scope="session")

0 commit comments

Comments
 (0)