File: conftest.py

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,488 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (34 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pytest

library = 'libraries/Populated Library.lplib'


@pytest.fixture
def library_editor(librepcb, helpers):
    """
    Fixture opening the library editor with an empty library
    """
    librepcb.add_local_library_to_workspace(path=library)
    with librepcb.open() as app:
        # Wait until the library scan is finished
        helpers.wait_for_library_scan_complete(app)

        # Open library manager
        app.widget('controlPanelOpenLibraryManagerButton').click()
        assert app.widget('libraryManager').properties()['visible'] is True

        # Select the empty library in library list
        library_list = app.widget('libraryManagerInstalledLibrariesList')
        helpers.wait_for_model_items_count(library_list, 2)
        library_item = library_list.model().items().items[1]
        library_list.select_item(library_item)

        # Open library editor of empty library
        app.widget('libraryManagerLibraryInfoWidgetOpenEditorButton').click()
        assert app.widget('libraryEditor').properties()['visible'] is True

        # Start the actual test
        yield app