|
1 | 1 | from types import SimpleNamespace |
2 | 2 | from pathlib import Path |
| 3 | +from behave import fixture, use_fixture |
3 | 4 |
|
4 | 5 | class NixOSNamespace(SimpleNamespace): |
5 | 6 | ''' Derived version of SimpleNamespace, helps unpack our NixOS test objects |
@@ -34,9 +35,26 @@ def wait_for_paperwm(self): |
34 | 35 | ''' |
35 | 36 | return self.machine.wait_until_succeeds(self._gjs_cmdline('paperwm.findModule("tiling").spaces._initDone')) |
36 | 37 |
|
| 38 | +@fixture |
| 39 | +def shell(context): |
| 40 | + ''' Wait for PaperWM to start |
| 41 | +
|
| 42 | + ### Wait, why do we need to specify which tests need PaperWM? |
| 43 | +
|
| 44 | + If we want to be able to assume given settings when PaperWM starts, we need |
| 45 | + to have already updated dconf with them by the time GNOME has finished |
| 46 | + loading, meaning the steps altering dconf cannot wait for the Shell. |
| 47 | +
|
| 48 | + The first Scenario should then make configuration assumptions, which the |
| 49 | + rest of the feature will be able to inherit. |
| 50 | + ''' |
| 51 | + context.nixos.wait_for_paperwm() |
| 52 | + |
| 53 | +def before_tag(context, tag): |
| 54 | + if tag == "fixture.shell": |
| 55 | + use_fixture(shell, context) |
| 56 | + |
37 | 57 | def before_all(context): |
38 | | - ''' Wait until PaperWM is actually running |
| 58 | + ''' Populate the context with NixOS test objects |
39 | 59 | ''' |
40 | | - print("Waiting for PaperWM...") |
41 | 60 | context.nixos = NixOSNamespace(context) |
42 | | - context.nixos.wait_for_paperwm() |
|
0 commit comments