--- a/tests/tools/test_application.py Sat Sep 16 21:04:34 2017 +0300
+++ b/tests/tools/test_application.py Sat Sep 16 21:19:19 2017 +0300
@@ -79,6 +79,7 @@
class BeremizApplicationTest(UserApplicationTest):
"""Test Beremiz as whole application"""
self.app = Beremiz.BeremizIDELauncher()
# disable default exception handler in Beremiz
@@ -92,6 +93,14 @@
+ def GetSkippedProjectTreeItems(self): + Returns the list of skipped items in the project tree. + Beremiz test don't need to skip any elemnts in the project tree. def OpenAllProjectElements(self):
"""Open editor for every object in the project tree"""
self.app.frame.ProjectTree.ExpandAll()
@@ -108,13 +117,22 @@
item = self.app.frame.ProjectTree.GetNextVisible(item)
- def CheckTestProject(self, name):
- project = self.GetProjectPath(name)
- print "Testing example " + name
+ def CheckTestProject(self, project): self.OpenAllProjectElements()
+ user_actions = self.GetUserActions() + self.RunUIActions(user_actions) + def GetProjectPath(self, project): + return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", project)) + def GetUserActions(self): + Returns list of user actions that will be executed + on every test project by testCheckProject test. [self.app.frame.SwitchFullScrMode, None],
[self.app.frame.SwitchFullScrMode, None],
@@ -126,12 +144,7 @@
[self.app.frame.CTR._Stop],
[self.app.frame.CTR._Disconnect],
- self.RunUIActions(user_actions)
- def GetProjectPath(self, project):
- return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", project))
"""Checks whether the app starts and finishes correctly"""
@@ -150,7 +163,13 @@
def testCheckProject(self, name):
- self.CheckTestProject(name)
+ Checks that test PLC project can be open, + compiled and run on SoftPLC. + project = self.GetProjectPath(name) + print "Testing example " + name + self.CheckTestProject(project) if __name__ == '__main__':