Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 17CC5E01016; Thu, 18 Aug 2016 02:42:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.50 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id DAC22E00CC0 for ; Thu, 18 Aug 2016 02:42:36 -0700 (PDT) Received: by mail-pa0-f50.google.com with SMTP id i5so4991732pat.2 for ; Thu, 18 Aug 2016 02:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uy9M5k0qpNAXVsP6ZeKs6jMXeIYLlUOxoZQTBgKDZEo=; b=zA2vTHf4sStrak56G7fufiZzEer4WmubJB6Sn9gmlaY4rPjWmHh3i8j2FI7pqWEA8Q yeENN5ISWZuVpfn0oLh2Sk88VLFC+O/fEr3icSjn8jPfXhMlrwdTgsiRjdRC2ZXsIRq1 cA3SElET6ZxJAtT2CyG0tMkqQelpbfQFqom+PPK+K+pMVyKYLOXxkBHnKgOvzzvA2Y49 T0qzaR5ORXh85hPvjBD8sqowyK2G28kwfa2Orsg4QFq0CCIKv7AFFsVbHvEsSgqh1h5X klBuB9ylSSqD2vyCZwd+VxysCY0+sskxZbdGkAbRtAEv2uUoDHPc5DCy8Xi6vKEfQF8k epBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uy9M5k0qpNAXVsP6ZeKs6jMXeIYLlUOxoZQTBgKDZEo=; b=TC/ruVMD4uaHWG3wrbw/PwFOYN7XEQZzT9qyLRFmzEyPKPGxvxvveqZFhpLTEWz//s +m/h2lO+jLHN0erJRQKDRYBUFYJWGYF4g0Gjcx4JG5bzdKe3xQK/cReHc5SbiEJPscIf PYxOdwmMBEMNzKlVPuasZrsTbZeasaKJnjq0WmS2bxBGQ6EELhTl+yFYwJ0ryEJdZTW8 TEgMbRP4R33Qat1jGl3CO2Fa2mOnUMMPhGIqY7vGOrfbgxdaHTOtElG+9vXbcV6Y6zTq 31IpFMC9yhG/OPMDt2zHedSOfYoue9AKF92Aso/CcMRDpcaWA+PPj/QcJlVo6LVkMEXJ lGBw== X-Gm-Message-State: AEkooutkK3GnGvqtjQkiVNRCsspNzRpBh2q3FCNgQmH0NFS5Nx3u7vhYxtr4NR5FixV7RdAo X-Received: by 10.66.66.203 with SMTP id h11mr2435056pat.5.1471513356591; Thu, 18 Aug 2016 02:42:36 -0700 (PDT) Received: from orion.ger.corp.intel.com ([192.55.54.44]) by smtp.gmail.com with ESMTPSA id e10sm2517365pay.39.2016.08.18.02.42.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Aug 2016 02:42:36 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 18 Aug 2016 10:42:16 +0100 Message-Id: <1471513336-13789-8-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471513336-13789-1-git-send-email-michael.g.wood@intel.com> References: <1471513336-13789-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 7/7] toaster: tests Add selenium test layer source switching layer details page X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 09:42:57 -0000 Add selenium tests for the new layer source switching functionality on the layer details page. Edits the values for git repository and saves and then edits the details for directory information and saves. Signed-off-by: Michael Wood --- .../tests/browser/test_layerdetails_page.py | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py index 2fa9672..72b6f60 100644 --- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py +++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py @@ -82,15 +82,17 @@ class TestLayerDetailsPage(SeleniumTestCase): self.get(self.url) self.click("#add-remove-layer-btn") + self.click("#edit-layer-source") + self.click("#repo") + + self.wait_until_visible("#layer-git-repo-url") # Open every edit box for btn in self.find_all("dd .glyphicon-edit"): btn.click() - self.wait_until_visible("dd input") - # Edit each value - for inputs in self.find_all("dd input[type=text]") + \ + for inputs in self.find_all("#layer-git input[type=text]") + \ self.find_all("dd textarea"): # ignore the tt inputs (twitter typeahead input) if "tt-" in inputs.get_attribute("class"): @@ -104,16 +106,20 @@ class TestLayerDetailsPage(SeleniumTestCase): inputs.send_keys("-edited") + # Save the new values for save_btn in self.find_all(".change-btn"): save_btn.click() + self.click("#save-changes-for-switch") + self.wait_until_visible("#edit-layer-source") + # Refresh the page to see if the new values are returned self.get(self.url) new_values = ["%s-edited" % old_val for old_val in self.initial_values] - for inputs in self.find_all('dd input[type="text"]') + \ + for inputs in self.find_all('#layer-git input[type="text"]') + \ self.find_all('dd textarea'): # ignore the tt inputs (twitter typeahead input) if "tt-" in inputs.get_attribute("class"): @@ -125,6 +131,24 @@ class TestLayerDetailsPage(SeleniumTestCase): "Expecting any of \"%s\" but got \"%s\"" % (new_values, value)) + # Now convert it to a local layer + self.click("#edit-layer-source") + self.click("#dir") + dir_input = self.wait_until_visible("#layer-dir-path-in-details") + + new_dir = "/home/test/my-meta-dir" + dir_input.send_keys(new_dir) + + self.click("#save-changes-for-switch") + self.wait_until_visible("#edit-layer-source") + + # Refresh the page to see if the new values are returned + self.get(self.url) + dir_input = self.find("#layer-dir-path-in-details") + self.assertTrue(new_dir in dir_input.get_attribute("value"), + "Expected %s in the dir value for layer directory" % + new_dir) + def test_delete_layer(self): """ Delete the layer """ -- 2.7.4