Skip to content

Commit 674e0f5

Browse files
Andrii MorozAndrii Moroz
authored andcommitted
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd into WD_1.X_dev
2 parents 203277c + 3abf11f commit 674e0f5

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

inc/extension_qt/q_view_executor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class QViewCmdExecutor : public ViewCmdExecutor {
3838
virtual void SendKeys(const string16& keys, Error** error);
3939
virtual void Close(Error** error);
4040
virtual void SwitchTo(Error** error);
41+
virtual void FindElement(const ElementId& root_element, const std::string& locator, const std::string& query, ElementId* element, Error** error);
4142
virtual void GetAlertMessage(std::string* text, Error** error);
4243
virtual void SetAlertPromptText(const std::string& alert_prompt_text, Error** error);
4344
virtual void AcceptOrDismissAlert(bool accept, Error** error);

inc/extension_qt/widget_view_executor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class QWidgetViewCmdExecutor : public QViewCmdExecutor {
6060
virtual void ElementSubmit(const ElementId& element, Error** error) NOT_SUPPORTED_IMPL;
6161
virtual void GetElementText(const ElementId& element, std::string* element_text, Error** error);
6262
virtual void GetElementCssProperty(const ElementId& element, const std::string& property, base::Value** value, Error** error) NOT_SUPPORTED_IMPL;
63-
virtual void FindElement(const ElementId& root_element, const std::string& locator, const std::string& query, ElementId* element, Error** error);
6463
virtual void FindElements(const ElementId& root_element, const std::string& locator, const std::string& query, std::vector<ElementId>* elements, Error** error);
6564
virtual void ActiveElement(ElementId* element, Error** error);
6665
virtual void SwitchToFrameWithNameOrId(const std::string& name_or_id, Error** error) NOT_SUPPORTED_IMPL;

src/webdriver/extension_qt/q_view_executor.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ void QViewCmdExecutor::SetBounds(const Rect& bounds, Error** error) {
7575
if (NULL == view)
7676
return;
7777

78+
if (!view->isTopLevel()) {
79+
*error = new Error(kUnknownError, "Cant set bounds to non top level view.");
80+
return;
81+
}
82+
7883
view->setGeometry(ConvertRectToQRect(bounds));
7984
}
8085

@@ -185,6 +190,15 @@ void QViewCmdExecutor::SwitchTo(Error** error) {
185190
session_->logger().Log(kInfoLogLevel, "SwitchTo - set current view ("+view_id_.id()+")");
186191
}
187192

193+
void QViewCmdExecutor::FindElement(const ElementId& root_element, const std::string& locator, const std::string& query, ElementId* element, Error** error) {
194+
std::vector<ElementId> elements;
195+
FindElements(root_element, locator, query, &elements, error);
196+
if (*error == NULL && !elements.empty())
197+
*element = elements[0];
198+
else if(*error == NULL)
199+
*error = new Error(kNoSuchElement);
200+
}
201+
188202
void QViewCmdExecutor::GetAlertMessage(std::string* text, Error** error) {
189203
QWidget* view = getView(view_id_, error);
190204
if (NULL == view)

src/webdriver/extension_qt/widget_view_executor.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -723,19 +723,6 @@ void QWidgetViewCmdExecutor::GetElementText(const ElementId& element, std::strin
723723
*error = new Error(kNoSuchElement);
724724
}
725725

726-
void QWidgetViewCmdExecutor::FindElement(const ElementId& root_element, const std::string& locator, const std::string& query, ElementId* element, Error** error) {
727-
QWidget* view = getView(view_id_, error);
728-
if (NULL == view)
729-
return;
730-
731-
std::vector<ElementId> elements;
732-
FindElements(root_element, locator, query, &elements, error);
733-
if (*error == NULL && elements.size() != 0)
734-
*element = elements[0];
735-
else if(*error == NULL)
736-
*error = new Error(kNoSuchElement);
737-
}
738-
739726
void QWidgetViewCmdExecutor::FindElements(const ElementId& root_element, const std::string& locator, const std::string& query, std::vector<ElementId>* elements, Error** error) {
740727
QWidget* view = getView(view_id_, error);
741728
if (NULL == view)

wd.gypi.merged_sample

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
'variables': {
3+
'QT5': '0', # change to '1' for enabling Qt5
4+
'WD_BUILD_MONGOOSE': '0',
5+
'WD_BUILD_MODP_B64': '1',
6+
'DESKTOP_QT_BIN_PATH': '/usr/lib/qt4/bin',
7+
'DESKTOP_QT_INC_PATH': '/usr/include',
8+
'DESKTOP_QT_LIB_PATH': '/usr/lib',
9+
'CISCO_QT_INC_PATH': '<(ROOT_PATH)/WEBKITQT48_SRC/dist/<(platform)/<(mode)/include',
10+
'CISCO_QT_LIB_PATH': '<(ROOT_PATH)/WEBKITQT48_SRC/dist/<(platform)/<(mode)/lib/',
11+
'CISCO_QT_BIN_PATH': '<(ROOT_PATH)/WEBKITQT48_SRC/dist/<(platform)/<(mode)/bin/',
12+
'CISCO_MONGOOSE_LIB_PATH': '<(ROOT_PATH)/MONGOOSE/dist/<(platform)/generic/<(mode)/lib',
13+
'CISCO_MONGOOSE_INC_PATH': '<(ROOT_PATH)/MONGOOSE/dist/<(platform)/generic/<(mode)/h',
14+
},
15+
}

wd.gypi.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
{
33
'variables': {
44
'QT5': '0', # change to '1' for enabling Qt5
5-
'WD_CONFIG_QWIDGET_VIEW': '1',
6-
'WD_CONFIG_QWIDGET_VIEW_ACCESSABILITY': '0',
7-
'WD_CONFIG_QML_VIEW': '1',
85
'WD_BUILD_MONGOOSE': '1',
96
'WD_BUILD_MODP_B64': '1',
107
'CISCO_QT_BIN_PATH': '/opt/qt4_nds/linux2_2/release/bin/',

0 commit comments

Comments
 (0)