Skip to content

Commit ce3c79a

Browse files
committed
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd into WD_1.X_dev
2 parents 6b41dcc + 46a8616 commit ce3c79a

File tree

3 files changed

+54
-13
lines changed

3 files changed

+54
-13
lines changed

src/webdriver/extension_qt/quick2_view_executor.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,10 +952,15 @@ void Quick2ViewCmdExecutor::SetPlayingPosition(const ElementId &element, double
952952
if (NULL == pItem)
953953
return;
954954

955-
QVariant positionVariant((int)(position * 1000));
956-
bool isPropertyAssigned = pItem->setProperty("position", positionVariant);
957955

958-
if(!isPropertyAssigned){
956+
double currentPosition = 0;
957+
GetPlayingPosition(element, &currentPosition, error);
958+
if(error)
959+
return;
960+
int positionOffset = (int)((position - currentPosition) * 1000);
961+
bool isMethodCalled = QMetaObject::invokeMethod(pItem,"seek", Q_ARG(int, positionOffset));
962+
963+
if(!isMethodCalled){
959964
(*error) = new Error(kUnknownError,
960965
std::string("Error while executing comand: There is no such member or the parameters did not match"));
961966
}

web/WebDriverJsDemo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@
327327
var elementId = event.target.getAttribute('elementId');
328328
var element = new webdriver.WebElement(self.driver, elementId);
329329
element.click();
330-
return false;
330+
return true;
331331
}
332332

333333
var xpath = getXPath(event.target);

web/widget_view_visualizer.xsl

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@
1111
</xsl:template>
1212

1313
<xsl:template match="QCheckBox">
14-
<input type="checkbox">
15-
<xsl:copy-of select="@elementId"/>
14+
<span>
1615
<xsl:call-template name="style"/>
17-
<xsl:value-of select="@text"/>
18-
</input>
16+
<input type="checkbox">
17+
<xsl:copy-of select="@elementId"/>
18+
<xsl:if test="@checked = 'true'">
19+
<xsl:attribute name="checked"/>
20+
</xsl:if>
21+
</input>
22+
<span>
23+
<xsl:value-of select="@text"/>
24+
</span>
25+
</span>
1926
</xsl:template>
2027
<xsl:template match="QLabel">
2128
<span>
@@ -40,17 +47,34 @@
4047
<input type="submit">
4148
<xsl:copy-of select="@elementId"/>
4249
<xsl:call-template name="style"/>
43-
<xsl:attribute name="value" select="@text"/>
50+
<xsl:attribute name="value">
51+
<xsl:value-of select="@text"/>
52+
</xsl:attribute>
4453
</input>
4554
</xsl:template>
55+
<xsl:template match="QRadioButton">
56+
<span>
57+
<xsl:call-template name="style"/>
58+
<input type="radio">
59+
<xsl:copy-of select="@elementId"/>
60+
<xsl:attribute name="name">
61+
<xsl:text>parent:</xsl:text>
62+
<xsl:value-of select="../@elementId"/>
63+
</xsl:attribute>
64+
</input>
65+
<span>
66+
<xsl:value-of select="@text"/>
67+
</span>
68+
</span>
69+
</xsl:template>
4670
<xsl:template match="QScrollArea">
4771
<div>
4872
<xsl:copy-of select="@elementId"/>
4973
<xsl:call-template name="style"/>
5074
<xsl:apply-templates/>
5175
</div>
5276
</xsl:template>
53-
<xsl:template match="QPlainTextEdit">
77+
<xsl:template match="QTextEdit|QPlainTextEdit">
5478
<textarea>
5579
<xsl:copy-of select="@elementId"/>
5680
<xsl:call-template name="style"/>
@@ -60,17 +84,29 @@
6084
<xsl:value-of select="@plainText"/>
6185
</textarea>
6286
</xsl:template>
87+
<xsl:template match="QWebView">
88+
<iframe>
89+
<xsl:copy-of select="@elementId"/>
90+
<xsl:call-template name="style"/>
91+
<xsl:attribute name="src">
92+
<xsl:value-of select="@url"/>
93+
</xsl:attribute>
94+
</iframe>
95+
</xsl:template>
6396

6497
<xsl:template name="style">
6598
<xsl:attribute name="style">
6699
<xsl:if test="@width">
67-
width: <xsl:value-of select="@width"/>;
100+
<xsl:text>width: </xsl:text><xsl:value-of select="@width"/><xsl:text>;</xsl:text>
68101
</xsl:if>
69102
<xsl:if test="@height">
70-
height: <xsl:value-of select="@height"/>;
103+
<xsl:text>height: </xsl:text><xsl:value-of select="@height"/><xsl:text>;</xsl:text>
71104
</xsl:if>
72105
<xsl:if test="@visible = 'false'">
73-
visibility: hidden;
106+
<xsl:text>display: none;</xsl:text>
107+
</xsl:if>
108+
<xsl:if test="@styleSheet">
109+
<xsl:value-of select="@styleSheet"/><xsl:text>;</xsl:text>
74110
</xsl:if>
75111
</xsl:attribute>
76112
</xsl:template>

0 commit comments

Comments
 (0)