nice-gui-utils 0.2.0.dev4__tar.gz → 0.2.2.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {nice-gui-utils-0.2.0.dev4/src/nice_gui_utils.egg-info → nice_gui_utils-0.2.2.dev0}/PKG-INFO +2 -2
  2. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/pyproject.toml +2 -2
  3. nice_gui_utils-0.2.2.dev0/src/nice_gui_utils/keycloak_js/__init__.py +1 -0
  4. nice_gui_utils-0.2.2.dev0/src/nice_gui_utils/router/__init__.py +1 -0
  5. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0/src/nice_gui_utils.egg-info}/PKG-INFO +2 -2
  6. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/src/nice_gui_utils.egg-info/SOURCES.txt +7 -7
  7. nice_gui_utils-0.2.2.dev0/src/nice_gui_utils.egg-info/top_level.txt +1 -0
  8. nice_gui_utils-0.2.2.dev0/tests/test_single_page.py +43 -0
  9. nice-gui-utils-0.2.0.dev4/src/keycloak_js/keycloak.js +0 -42
  10. nice-gui-utils-0.2.0.dev4/src/nice_gui_utils.egg-info/top_level.txt +0 -2
  11. nice-gui-utils-0.2.0.dev4/src/router/__init__.py +0 -0
  12. nice-gui-utils-0.2.0.dev4/src/router/router_frame.js +0 -26
  13. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/LICENSE +0 -0
  14. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/README.md +0 -0
  15. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/requirements.txt +0 -0
  16. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/setup.cfg +0 -0
  17. {nice-gui-utils-0.2.0.dev4/src/keycloak_js → nice_gui_utils-0.2.2.dev0/src/nice_gui_utils}/__init__.py +0 -0
  18. {nice-gui-utils-0.2.0.dev4/src → nice_gui_utils-0.2.2.dev0/src/nice_gui_utils}/keycloak_js/keycloak.py +0 -0
  19. {nice-gui-utils-0.2.0.dev4/src → nice_gui_utils-0.2.2.dev0/src/nice_gui_utils}/router/router.py +0 -0
  20. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/src/nice_gui_utils.egg-info/dependency_links.txt +0 -0
  21. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/src/nice_gui_utils.egg-info/requires.txt +0 -0
  22. {nice-gui-utils-0.2.0.dev4 → nice_gui_utils-0.2.2.dev0}/tests/test_login.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: nice-gui-utils
3
- Version: 0.2.0.dev4
2
+ Name: nice_gui_utils
3
+ Version: 0.2.2.dev0
4
4
  Summary: Utils to use with NiceGUI.
5
5
  Author: Harter Kern
6
6
  Project-URL: Homepage, https://gitlab.com/harter-kern-public/nice-gui-utils
@@ -3,8 +3,8 @@ requires = ["setuptools>=61.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
- name = "nice-gui-utils"
7
- version = "0.2.0dev4"
6
+ name = "nice_gui_utils"
7
+ version = "0.2.2dev"
8
8
  dynamic = ["dependencies"]
9
9
  authors = [
10
10
  { name = "Harter Kern" },
@@ -0,0 +1 @@
1
+ from .keycloak import KeycloakConfig, Keycloak
@@ -0,0 +1 @@
1
+ from .router import Router
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: nice-gui-utils
3
- Version: 0.2.0.dev4
2
+ Name: nice_gui_utils
3
+ Version: 0.2.2.dev0
4
4
  Summary: Utils to use with NiceGUI.
5
5
  Author: Harter Kern
6
6
  Project-URL: Homepage, https://gitlab.com/harter-kern-public/nice-gui-utils
@@ -2,15 +2,15 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  requirements.txt
5
- src/keycloak_js/__init__.py
6
- src/keycloak_js/keycloak.js
7
- src/keycloak_js/keycloak.py
5
+ src/nice_gui_utils/__init__.py
8
6
  src/nice_gui_utils.egg-info/PKG-INFO
9
7
  src/nice_gui_utils.egg-info/SOURCES.txt
10
8
  src/nice_gui_utils.egg-info/dependency_links.txt
11
9
  src/nice_gui_utils.egg-info/requires.txt
12
10
  src/nice_gui_utils.egg-info/top_level.txt
13
- src/router/__init__.py
14
- src/router/router.py
15
- src/router/router_frame.js
16
- tests/test_login.py
11
+ src/nice_gui_utils/keycloak_js/__init__.py
12
+ src/nice_gui_utils/keycloak_js/keycloak.py
13
+ src/nice_gui_utils/router/__init__.py
14
+ src/nice_gui_utils/router/router.py
15
+ tests/test_login.py
16
+ tests/test_single_page.py
@@ -0,0 +1,43 @@
1
+ from time import sleep
2
+
3
+ from selenium.common import NoSuchElementException, ElementNotInteractableException
4
+ from selenium.webdriver.common.by import By
5
+ from selenium.webdriver.remote.webelement import WebElement
6
+ from selenium.webdriver.support.wait import WebDriverWait
7
+
8
+ from tests.test_login import firefox_webdriver
9
+
10
+
11
+ def test_single_page_navigation():
12
+ with firefox_webdriver() as driver:
13
+ driver.get('http://localhost:8080/spa')
14
+ sleep(3)
15
+ errors = [NoSuchElementException, ElementNotInteractableException]
16
+ wait = WebDriverWait(driver, timeout=2, ignored_exceptions=errors)
17
+
18
+ content_one_label: WebElement = driver.find_element(By.ID, 'page-one-label')
19
+ wait.until(lambda d: content_one_label.is_displayed())
20
+ assert content_one_label.text == 'Content One'
21
+ assert driver.current_url == 'http://localhost:8080/spa/'
22
+
23
+ page_one_button = driver.find_element(By.ID, 'page-one-button')
24
+ page_two_button = driver.find_element(By.ID, 'page-two-button')
25
+ page_three_button = driver.find_element(By.ID, 'page-three-button')
26
+
27
+ page_two_button.click()
28
+ content_two_label: WebElement = driver.find_element(By.ID, 'page-two-label')
29
+ wait.until(lambda d: content_two_label.is_displayed())
30
+ assert content_two_label.text == 'Content Two'
31
+ assert driver.current_url == 'http://localhost:8080/spa/two'
32
+
33
+ page_three_button.click()
34
+ content_three_label: WebElement = driver.find_element(By.ID, 'page-three-label')
35
+ wait.until(lambda d: content_three_label.is_displayed())
36
+ assert content_three_label.text == 'Content Three'
37
+ assert driver.current_url == 'http://localhost:8080/spa/three'
38
+
39
+ page_one_button.click()
40
+ content_one_label: WebElement = driver.find_element(By.ID, 'page-one-label')
41
+ wait.until(lambda d: content_one_label.is_displayed())
42
+ assert content_one_label.text == 'Content One'
43
+ assert driver.current_url == 'http://localhost:8080/spa/'
@@ -1,42 +0,0 @@
1
- export default {
2
- template: "<div></div>",
3
- mounted() {
4
- this.keycloak = new Keycloak({
5
- url: this.url,
6
- realm: this.realm,
7
- clientId: this.clientId
8
- });
9
-
10
- this.keycloak.init(this.initOptions).then(
11
- authenticated => {
12
- if (authenticated) {
13
- this.keycloak.onTokenExpired = this.keycloak.updateToken;
14
- }
15
- }
16
-
17
- );
18
- },
19
- methods: {
20
- token() {
21
- return this.keycloak.token;
22
- },
23
- refreshToken() {
24
- return this.keycloak.refreshToken;
25
- },
26
- authenticated() {
27
- return this.keycloak.authenticated;
28
- },
29
- login(options) {
30
- return this.keycloak.login(options);
31
- },
32
- logout(options) {
33
- return this.keycloak.logout(options);
34
- }
35
- },
36
- props: {
37
- url: String,
38
- realm: String,
39
- clientId: String,
40
- initOptions: Object
41
- }
42
- };
@@ -1,2 +0,0 @@
1
- keycloak_js
2
- router
File without changes
@@ -1,26 +0,0 @@
1
- export default {
2
- template: "<div><slot></slot></div>",
3
- mounted() {
4
- window.addEventListener("popstate", (event) => {
5
- if (event.state?.page) {
6
- this.$emit("open", event.state.page);
7
- }
8
- });
9
- const connectInterval = setInterval(async () => {
10
- if (window.socket.id === undefined)
11
- return;
12
- this.$emit("open", window.location.pathname);
13
- clearInterval(connectInterval);
14
- }, this.checkInterval);
15
- },
16
- props: {
17
- checkInterval: Number
18
- },
19
- methods: {
20
- updateHistory(path) {
21
- if (window.location.pathname !== path) {
22
- history.pushState({page: path}, "", path);
23
- }
24
- }
25
- }
26
- };