You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, install the latest version of Python from [downloads](https://www.python.org/downloads/) and
31
-
[pipenv](https://pipenv.readthedocs.io/en/latest/install/) to help you manage dependencies and virtual environments.
31
+
[uv](https://docs.astral.sh/uv/getting-started/installation/) to help you manage dependencies and virtual environments.
32
32
33
33
Then, create the folder for the new project, in our case the project is called 'myrecommendations':
34
34
@@ -38,13 +38,15 @@ $ mkdir myrecommendations
38
38
$ cd myrecommendations
39
39
```
40
40
41
-
Once in the `myrecommendations` folder, activate the pipenv virtual environment to keep the Python packages
41
+
Once in the `myrecommendations` folder, create a uv virtual environment to keep the Python packages
42
42
for your project organised and start by installing Django. Then, create a new Django project:
43
43
44
44
```shell script
45
-
$ pipenv shell
45
+
$ uv venv
46
46
47
-
$ pipenv install Django
47
+
$ source .venv/bin/activate # On Windows use: .venv\Scripts\activate
48
+
49
+
$ uv pip install Django
48
50
49
51
$ django-admin startproject myrecommendations .
50
52
```
@@ -174,8 +176,8 @@ To facilitate the description of the feature scenarios, while connecting them to
174
176
To get Behave and integrate it with Django, install:
175
177
176
178
```shell script
177
-
$ pipenv install behave
178
-
$ pipenv install behave-django
179
+
$ uv pip install behave
180
+
$ uv pip install behave-django
179
181
```
180
182
181
183
And add the 'behave_django' application at the end of the INSTALLED_APPS list in *myrecommendations/settings.py*:
@@ -196,52 +198,10 @@ INSTALLED_APPS = [
196
198
Moreover, to make it possible to guide a browser from the test, and thus check if the application follows the expected behaviour from a end-user perspective, we will also use Splinter. It can be installed with the following command:
197
199
198
200
```shell script
199
-
$ pipenv install splinter
200
-
```
201
-
202
-
Finally, for end-to-end test, it is necessary to have a browser to test from client side. With Splinter, different browsers can be configured for testing, for instance Chrome, the most common one.
203
-
204
-
Assuming Chrome is already installed in your computer, the only requirement to use it for automated testing is the ChromeDriver, available for Windows, Linux and Mac from [https://sites.google.com/a/chromium.org/chromedriver/downloads](https://sites.google.com/a/chromium.org/chromedriver/downloads)
205
-
206
-
You can also install it using different package managers. For instance with **apt** on Linux:
Or **[Chocolatey](https://chocolatey.org/docs/installation)** on Windows:
222
-
223
-
```shell script
224
-
choco install chromedriver
225
-
```
226
-
227
-
### Testing with Firefox instead of Chrome ###
228
-
229
-
Alternatively, for Firefox, install the browser:
230
-
231
-
```
232
-
sudo apt-get update
233
-
sudo apt-get install firefox
234
-
```
235
-
236
-
Then, download Geckodriver and unpack it from [https://github.com/mozilla/geckodriver/releases/](https://github.com/mozilla/geckodriver/releases/)
237
-
238
-
Finally, add the geckodriver to your path:
239
-
240
-
```
241
-
export PATH=$PATH:/your/path/to/geckodriver
242
-
```
243
-
244
-
And configure the test environment in `environment.py`, as detailed next, to use `firefox` instead of `chrome`.
204
+
Finally, for end-to-end test, it is necessary to have a browser to test from client side. With Splinter and Selenium, different browsers can be configured for testing, for instance Chrome or Firefox, which should be installed in the machine where the tests are run.
245
205
246
206
## Environment ##
247
207
@@ -254,6 +214,7 @@ from splinter.browser import Browser
Both steps are parameterized, so we can use the steps to login users with any username and password, as long as we have previously created them and the password matches.
0 commit comments