Bläddra i källkod

Add waiting for canvas load when testing models.

Bentley James Oakes 7 år sedan
förälder
incheckning
a4f0967773
2 ändrade filer med 11 tillägg och 1 borttagningar
  1. 1 0
      tests/model_building_utils.js
  2. 10 1
      tests/test_utils.js

+ 1 - 0
tests/model_building_utils.js

@@ -293,6 +293,7 @@ function scroll_geometry_element(client, element, scrollAmount, scrollTimes) {
 
 module.exports = {
     '@disabled': true,
+    canvas,
     get_element_div,
     get_assoc_div,
     get_class_div,

+ 10 - 1
tests/test_utils.js

@@ -1,3 +1,5 @@
+let model_building_utils = require('./model_building_utils');
+
 function login(client) {
     client.execute(
         function () {
@@ -14,14 +16,19 @@ function login(client) {
 
 function load_model(client, fnames) {
 
+    client.waitForElementPresent(model_building_utils.canvas, 2000, "Canvas loaded");
+
     for (const name of fnames) {
+
+        client.pause(300);
+
         client.execute(
             function (fname) {
                 _loadModel(fname);
             }, [name], null
         );
 
-        client.pause(1000);
+        client.pause(300);
 
         client.element('css selector', '#dialog_btn', function (result) {
             if (result.status != -1) {
@@ -46,6 +53,8 @@ function load_model(client, fnames) {
 
 function load_toolbar(client, fnames) {
 
+    client.waitForElementPresent(model_building_utils.canvas, 2000, "Canvas loaded");
+
     for (let name of fnames) {
 
         client.execute(