From 32ebfa78cd0d3d1216a8ba7800659e90444247cc Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 6 Jan 2024 19:52:14 +0000 Subject: [PATCH] Some automation for the identity app. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4737 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/identity/app.js | 4 ++-- tools/autotest.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/identity/app.js b/apps/identity/app.js index 3e24026a..2aa50363 100644 --- a/apps/identity/app.js +++ b/apps/identity/app.js @@ -70,7 +70,7 @@ async function main() {

SSB Identity Management

Create a new identity

- +

Import an SSB Identity from 12 BIP39 English Words

Identities

@@ -84,4 +84,4 @@ async function main() { `); } -main(); \ No newline at end of file +main(); diff --git a/tools/autotest.py b/tools/autotest.py index 66728ec1..7087f178 100755 --- a/tools/autotest.py +++ b/tools/autotest.py @@ -33,6 +33,38 @@ try: driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'confirm').send_keys('test_password') driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'loginButton').click() + wait.until(expected_conditions.presence_of_element_located((By.ID, 'document'))) + driver.switch_to.frame(driver.find_element(By.ID, 'document')) + wait.until(expected_conditions.presence_of_element_located((By.LINK_TEXT, 'identity'))).click() + driver.switch_to.default_content() + + wait.until(expected_conditions.presence_of_element_located((By.ID, 'content'))) + driver.switch_to.frame(wait.until(expected_conditions.presence_of_element_located((By.ID, 'document')))) + + wait.until(expected_conditions.presence_of_element_located((By.ID, 'create_id'))).click() + driver.switch_to.alert.accept() + id0 = wait.until(expected_conditions.presence_of_element_located((By.TAG_NAME, 'li'))).text.split(' ')[-1] + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//li/button[text()="Export Identity"]'))).click() + driver.switch_to.default_content() + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//button[text()="✅ Allow"]'))).click() + driver.switch_to.frame(wait.until(expected_conditions.presence_of_element_located((By.ID, 'document')))) + words = wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//li//textarea'))).get_attribute('value') + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//li/button[text()="Delete Identity"]'))).click() + driver.switch_to.alert.send_keys('DELETE') + driver.switch_to.alert.accept() + driver.switch_to.default_content() + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//button[text()="✅ Allow"]'))).click() + driver.switch_to.alert.accept() + driver.switch_to.frame(wait.until(expected_conditions.presence_of_element_located((By.ID, 'document')))) + words = wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//textarea'))).send_keys(words) + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//button[text()="Import Identity"]'))).click() + driver.switch_to.default_content() + wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//button[text()="✅ Allow"]'))).click() + driver.switch_to.alert.accept() + driver.switch_to.frame(wait.until(expected_conditions.presence_of_element_located((By.ID, 'document')))) + id1 = wait.until(expected_conditions.presence_of_element_located((By.TAG_NAME, 'li'))).text.split(' ')[-1] + + driver.get('http://localhost:8888') wait.until(expected_conditions.presence_of_element_located((By.ID, 'document'))) driver.switch_to.frame(driver.find_element(By.ID, 'document')) wait.until(expected_conditions.presence_of_element_located((By.LINK_TEXT, 'ssb'))).click()