-
Notifications
You must be signed in to change notification settings - Fork 2
/
WebPuppeteerWebElement.hpp
53 lines (43 loc) · 1.3 KB
/
WebPuppeteerWebElement.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <QObject>
#include <QWebElement>
#include <QScriptValue>
class WebPuppeteerTab;
class WebPuppeteerWebElement: public QObject {
Q_OBJECT;
public:
WebPuppeteerWebElement(WebPuppeteerTab *parent, QWebElement el);
public slots:
QString attribute(const QString &name);
void setAttribute(const QString &name, const QString &value);
bool hasAttribute(const QString &name);
QString xml(); // return element as xml
QString textContent();
QScriptValue eval(const QString &js);
bool click();
bool onblur();
bool onchange();
// CSS
void setStyleProperty(const QString &name, const QString &value);
QString getComputedStyle(const QString &name);
// details
QString tagName();
// fidning elements
QScriptValue find(QScriptValue);
QScriptValue findFirst(const QString &selector);
QScriptValue findAll(const QString &selector);
QScriptValue findAllContaining(const QString &text);
QScriptValue getElementById(const QString &id);
QScriptValue getElementsByTagName(const QString &tag);
QScriptValue getElementsByName(const QString &name);
QScriptValue parentNode();
QScriptValue firstChild();
QScriptValue nextSibling();
QScriptValue frameDocument(QString framename);
// focus
void setFocus();
bool hasFocus();
private:
QWebElement e;
WebPuppeteerTab *parent;
QList<QWebElement> allChildren();
};