From 557ba91d4405f81e4341025475481a0179f5bd7f Mon Sep 17 00:00:00 2001 From: Kristijan Mitrovic Date: Mon, 25 May 2020 17:15:22 +0200 Subject: [PATCH] Set waiting for keys in test inbox --- .../models/include/get_network_keys.json | 18 ++++++----------- .../models/tests/live/backup_and_restore.json | 20 ++++++------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/bubble-server/src/test/resources/models/include/get_network_keys.json b/bubble-server/src/test/resources/models/include/get_network_keys.json index 02ab23c8..e39d75d9 100644 --- a/bubble-server/src/test/resources/models/include/get_network_keys.json +++ b/bubble-server/src/test/resources/models/include/get_network_keys.json @@ -16,15 +16,12 @@ }, { - "before": "sleep 3s", - "comment": "check email inbox, expect network keys request", - "request": { - "uri": "debug/inbox/email/<>?type=request&action=password&target=network" - }, + "comment": "await and get network keys request in email inbox", + "before": "await_url debug/inbox/email/<>?type=request&action=password&target=network 3m 5s len(await_json) > 0", + "request": { "uri": "debug/inbox/email/<>?type=request&action=password&target=network" }, "response": { "store": "emailInbox", "check": [ - {"condition": "json.length >= 1"}, {"condition": "'{{json.[0].ctx.message.messageType}}' == 'request'"}, {"condition": "'{{json.[0].ctx.message.action}}' == 'password'"}, {"condition": "'{{json.[0].ctx.message.target}}' == 'network'"} @@ -41,15 +38,12 @@ }, { - "before": "sleep 3s", - "comment": "check email inbox for key request confirmation", - "request": { - "uri": "debug/inbox/email/<>?type=confirmation&action=password&target=network" - }, + "comment": "await and get key request confirmation from email inbox", + "before": "await_url debug/inbox/email/<>?type=confirmation&action=password&target=network 3m 5s len(await_json) > 0", + "request": { "uri": "debug/inbox/email/<>?type=confirmation&action=password&target=network" }, "response": { "store": "emailInbox", "check": [ - {"condition": "json.length >= 1"}, {"condition": "'{{json.[0].ctx.message.messageType}}' == 'confirmation'"}, {"condition": "'{{json.[0].ctx.message.action}}' == 'password'"}, {"condition": "'{{json.[0].ctx.message.target}}' == 'network'"} diff --git a/bubble-server/src/test/resources/models/tests/live/backup_and_restore.json b/bubble-server/src/test/resources/models/tests/live/backup_and_restore.json index 0712e849..034fea16 100644 --- a/bubble-server/src/test/resources/models/tests/live/backup_and_restore.json +++ b/bubble-server/src/test/resources/models/tests/live/backup_and_restore.json @@ -119,17 +119,10 @@ }, { - "before": "await_url me/networks/{{bubbleNetwork.network}}/backups/test_backup?status=backup_completed 5m 10s", - "comment": "find completed backup", - "request": { - "uri": "me/networks/{{bubbleNetwork.network}}/backups/test_backup" - }, - "response": { - "store": "backup", - "check": [ - {"condition": "json.getStatus().name() == 'backup_completed'"} - ] - } + "comment": "await completed backup and store in the context", + "before": "await_url me/networks/{{bubbleNetwork.network}}/backups/test_backup?status=backup_completed 10m 15s", + "request": { "uri": "me/networks/{{bubbleNetwork.network}}/backups/test_backup?status=backup_completed" }, + "response": { "store": "backup" } }, { @@ -192,12 +185,11 @@ "password": "Passw0rd!!" }, "method": "put" - }, - "after": "sleep 240s" // give the restore some time to stop the server, restore and restart + } }, { - "before": "await_url .bubble 10m 20s", + "before": "await_url .bubble 4m:10m 20s", "comment": "login to restored bubble", "request": { "session": "new",