[Freedombox-discuss] issue https://salsa.debian.org/freedombox-team/freedombox/-/issues/1998

Tiago Zaniquelli zani0x03 at protonmail.com
Tue Jun 8 20:05:20 BST 2021


OK... I understood, but I suspect that the error is other or I'm doing somenthing wrong.
When I execute
py.test-3 --include-functional plinth/modules/users/tests/
After that I had the same result...
"
FAILED plinth/modules/users/tests/test_functional.py::test_create_user - splinter.exceptions.ElementDoesNotExist: no elements could be found with css "input[type=submit]"
"
Do you know something about that?

Regards,
Tiago Zaniquelli

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Em terça-feira, junho 8, 2021 2:07 PM, Fioddor Superconcentrado <fioddor at gmail.com> escreveu:

> You should have a look inside plinth/modules/storage/tests/ directory.
>
> storage.feature is the behaviour description of the tests. It is written in an easy human-readable formal language called Gherkin. Currently it contains only one scenario (Scenario: List disks).
>
> 'Background' marks the part that is common to all scenarios. But as I said, we currently have only one in this file.
> The line 'Given I'm a logged in user' logs' the user in.
>
> The line 'Given I'm on the storage page' calls the function in file test_functional.py marked with '@given(parsers.parse("I'm on the {name:w} page"))'.
> The line'Then the root disk should be shown'calls the function in file test_functional.py marked with '@then('the root disk should be shown')'.
>
> This way, the functional behaviour (independent from the implementation) is defined in *.features files. And then other *.py files resolve the underlying implementation.
>
> Now we need to fix the test by making it check first if it is running inside a container (with systemd-detect-virt --container) and if that's the case, it should report 'skipped' as test result and abort/skip the rest of the test.
>
> We should apply the rule at scenario level, because If we in the future add another scenario, only the current one should be skipped (and only if run within a container).
>
> The check to make sure we're not running inside a container should be reusable for other scenarios even beyond storage tests. So if we consider it functional, it would belong in the common library for functional steps: plinth/tests/functional/step_definitions.py, where the function which logs the user resides. But "being run on a container" sounds technical rather than functional, so it most likely belongs somewhere else under plinth/tests. Perhaps __init__.py? Or config.py?
>
> El mar, 8 jun 2021 a las 15:57, Tiago Zaniquelli via Freedombox-discuss (<freedombox-discuss at alioth-lists.debian.net>) escribió:
>
>> Ok...
>>
>> I did the two suggestion...
>>
>> First(first.png)... it showed me skipped (test_list_disks)...
>>
>> Second(second_one.png, second_two.png)...it showed me a error because some html... Is this error that need to correct?
>>
>> Regards,
>>
>> Tiago Zaniquelli
>>
>> Sent with ProtonMail Secure Email.
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> Em segunda-feira, junho 7, 2021 7:39 PM, James Valleroy via Freedombox-discuss <freedombox-discuss at alioth-lists.debian.net> escreveu:
>>
>>> On 6/7/21 4:35 PM, Tiago Zaniquelli via Freedombox-discuss wrote:
>>>
>>> > Ahhh, ok.
>>> > I tried to simulate, but for me everything is ok, and I'm inside the container
>>> > Could you help me simulate?
>>>
>>> Note that the functional tests are skipped by default.
>>> To include them, add the "--include-functional" option:
>>>
>>> $ py.test-3 --include-functional plinth/modules/storage/tests/
>>>
>>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>
>>> James
>>>
>>> Freedombox-discuss mailing list
>>> Freedombox-discuss at alioth-lists.debian.net
>>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss
>>
>> _______________________________________________
>> Freedombox-discuss mailing list
>> Freedombox-discuss at alioth-lists.debian.net
>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/freedombox-discuss/attachments/20210608/eb76585d/attachment-0001.htm>


More information about the Freedombox-discuss mailing list