1 # Copyright (C) 2014-2023 CEA, EDF
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # [Scenario] XAO-import
23 # [Topic] 'Exchange' functionality
24 # [Tested functionality]
25 # [Summary description]
29 source(findFile("scripts", "common.py"))
31 # [step] Launch SALOME
32 startApplication("salome_run.sh")
36 # [step] Activate NewGeom
39 # [step] Create new Part
40 activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
41 activateItem(waitForObjectItem(":Part_QMenu", "New part"))
43 # [step] Create Import feature
44 activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
45 activateItem(waitForObjectItem(":Part_QMenu", "Import"))
47 # [step] Select file 'exchange/xao/test.xao' and apply the feature
48 file_path = os.path.join(DATA_PATH, 'exchange', 'xao', 'test.xao');
49 mouseClick(waitForObject(":property_panel_dock...._QPushButton"), 10, 10, 0, Qt.LeftButton)
50 mouseClick(waitForObjectItem(":property_panel_dock.fileTypeCombo_QComboBox", "XAO files (*\\.XAO)"), 10, 10, 0, Qt.LeftButton)
51 type(waitForObject(":fileNameEdit_QLineEdit_3"), file_path)
52 type(waitForObject(":fileNameEdit_QLineEdit_3"), "<Return>")
53 clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
55 # [step] Check that the body is visible in the view [vp BODY]
56 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Bodies (1).mygeom\\_1", 10, 10, 0)
57 activateItem(waitForObjectItem(":_QMenu", "Show only"))
61 # [step] In Object Browser check that the Import feature name is "mygeom"
62 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.mygeom")
64 # [step] In Object Browser check new body: mygeom_1
65 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1).mygeom\\_1")
66 # [step] In Object Browser check new groups: boite_1, Group_2
67 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Groups (2).boite\\_1")
68 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Groups (2).Group\\_2")
70 # [step] Check the group boite_1 is a solid [vp GROUP_1]
71 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Groups (2).boite\\_1", 10, 10, 0)
72 activateItem(waitForObjectItem(":_QMenu", "Show only"))
76 # [step] Check the group Group_2 is a list of 2 faces [vp GROUP_2]
77 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Groups (2).Group\\_2", 10, 10, 0)
78 activateItem(waitForObjectItem(":_QMenu", "Show only"))
82 # [step] Close application without saving