]> SALOME platform Git repositories - modules/shaper.git/blob - test.squish/suite_FEATURE_EXCHANGE/tst_XAO-import/test.py
Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / test.squish / suite_FEATURE_EXCHANGE / tst_XAO-import / 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 def main():
22     # [project] NewGEOM
23     # [Scenario] XAO-import
24     # [Topic] 'Exchange' functionality
25     # [Tested functionality]
26     # [Summary description]
27     # [Expected results]
28     # [General comments]
29
30     source(findFile("scripts", "common.py"))
31
32     # [step] Launch SALOME
33     startApplication("salome_run.sh")
34
35     set_defaults()
36
37     # [step] Activate NewGeom
38     activate_newgeom()
39
40     # [step] Create new Part
41     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
42     activateItem(waitForObjectItem(":Part_QMenu", "New part"))
43
44     # [step] Create Import feature
45     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
46     activateItem(waitForObjectItem(":Part_QMenu", "Import"))
47
48     # [step] Select file 'exchange/xao/test.xao' and apply the feature
49     file_path = os.path.join(DATA_PATH, 'exchange', 'xao', 'test.xao');
50     mouseClick(waitForObject(":property_panel_dock...._QPushButton"), 10, 10, 0, Qt.LeftButton)
51     mouseClick(waitForObjectItem(":property_panel_dock.fileTypeCombo_QComboBox", "XAO files (*\\.XAO)"), 10, 10, 0, Qt.LeftButton)
52     type(waitForObject(":fileNameEdit_QLineEdit_3"), file_path)
53     type(waitForObject(":fileNameEdit_QLineEdit_3"), "<Return>")
54     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
55
56     # [step] Check that the body is visible in the view [vp BODY]
57     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Bodies (1).mygeom\\_1", 10, 10, 0)
58     activateItem(waitForObjectItem(":_QMenu", "Show only"))
59     fit_all()
60     test.vp("BODY")
61
62     # [step] In Object Browser check that the Import feature name is "mygeom"
63     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.mygeom")
64
65     # [step] In Object Browser check new body: mygeom_1
66     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1).mygeom\\_1")
67     # [step] In Object Browser check new groups: boite_1, Group_2
68     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Groups (2).boite\\_1")
69     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Groups (2).Group\\_2")
70
71     # [step] Check the group boite_1 is a solid [vp GROUP_1]
72     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Groups (2).boite\\_1", 10, 10, 0)
73     activateItem(waitForObjectItem(":_QMenu", "Show only"))
74     fit_all()
75     test.vp("GROUP_1")
76
77     # [step] Check the group Group_2 is a list of 2 faces [vp GROUP_2]
78     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Groups (2).Group\\_2", 10, 10, 0)
79     activateItem(waitForObjectItem(":_QMenu", "Show only"))
80     fit_all()
81     test.vp("GROUP_2")
82
83     # [step] Close application without saving
84     close_application()