]> SALOME platform Git repositories - modules/shaper.git/blob - test.squish/suite_STANDALONE/tst_818/test.py
Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / test.squish / suite_STANDALONE / tst_818 / test.py
1 ## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 ##
3 ## This library is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU Lesser General Public
5 ## License as published by the Free Software Foundation; either
6 ## version 2.1 of the License, or (at your option) any later version.
7 ##
8 ## This library is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 ## Lesser General Public License for more details.
12 ##
13 ## You should have received a copy of the GNU Lesser General Public
14 ## License along with this library; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 ##
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 import re
22
23 def main():
24     source(findFile("scripts", "common.py"))
25
26     startApplication("linux_run.sh")
27     set_defaults()
28
29     #[step] Create parameter 'a = 100'
30     parameter_create("a", "100")
31
32     #[step] Create sketch with line (0,0) - (a, 0)
33     sketch_create(help_points("XY_plane"), lambda: line_create((0, 0), ("a", 0)))
34
35     #[step] Activate context menu for parameter 'a' and click 'Delete'
36     waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1)")
37     clickItem(":Object browser_XGUI_DataTree", "Parameters (1)", -10, 10, 0, Qt.LeftButton)
38     waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100")
39     clickItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100", 10, 10, 0, Qt.LeftButton)
40     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).a = 100", 10, 10, 0)
41
42     activateItem(waitForObjectItem(":_QMenu", "Delete"))
43
44     #[check] Message box with "Selected features are used in the following features: SketchLine_1. These features will be deleted.\nAlso these features will be deleted: Sketch_1.\nWould you like to continue?" should appear
45     waitFor("object.exists(':Delete features.Label_QLabel')", 20000)
46
47     an_expected = """Selected parameters are used in the following features: SketchLine_1.
48 These features will be deleted.
49 (Also these features will be deleted: Sketch_1)
50 Or parameters could be replaced by their values.
51 Would you like to continue?"""
52     test.compare(str(findObject(":Delete features.Label_QLabel").text), an_expected)
53
54     #[step] Click 'Yes' and close application
55     clickButton(waitForObject(":Delete features.Yes_QPushButton"))