gemini
gemini copied to clipboard
Possibility to capture element if it's hidden during page load
My config:
gemini.suite('popup ' , function (child) {
child
.setUrl('url/to/page')
.before(function (actions, find) {
actions.setWindowSize(1200, 800);
actions.click(find('.show-popup'));
actions.waitForElementToShow('.popup', 2000);
})
.setCaptureElements('.popup')
.capture('plain');
});
result:
StateError: Area with css selector : .popup is hidden
expected behavior:
captured popup.
Do you really need to change your window size from the test, not from the config? And more correctly to do some action in this way:
gemini.suite('popup' , function (child) {
child
.setUrl('url/to/page')
.setCaptureElements('.popup')
.capture('plain', function(actions) {
actions
.click('.show-popup')
.waitForElementToShow('.popup', 2000);
});
});
Also, to capture popup
with some element you can wrap them with some extra div
and set it as captureElement
Thanks for the response!
I tried your snippet, but result is the same:
StateError: Area with css selector : .popup is hidden
It's because popup is hidden during page load, I suppose. Feels like a bug.
I'm not sure but it seems like I have this bug too. The test below is doesn't work:
gemini.suite('test-name', function(suite) {
suite.setUrl('test-url')
.setCaptureElements('[data-ix=eventappear]')
.capture('plain', function(actions) {
actions.waitForElementToShow('[data-ix=eventappear]', 30000);
});
});
Result is Area with css selector : [data-ix=eventappear] is hidden
. And it appears after 5-7 seconds of running gemini update
.
But the next test suite works fine:
gemini.suite('test-name', function(suite) {
suite.setUrl('test-url')
.before(function(actions) {
actions.wait(30000);
})
.setCaptureElements('[data-ix=eventappear]')
.capture('plain');
});
Can you provide your page for testing (also we need info for your environment)? I can't reproduce your problem. waitForElementToShow
method will wait for showing of your selector exactly for timeout
period specified in argument.
@sipayRT
Env: OS X 10.11.6, node v.4.5.0, npm v.2.15.9 Gemini: v.4.11.0 PhantomJS: v.2.1.12
.gemini.yml:
rootUrl: http://dev2dev.ru/
browsers:
PhantomJS:
compositeImage: true
desiredCapabilities:
browserName: phantomjs
test.js:
gemini.suite('dev2dev', function(suite) {
suite.setUrl('/')
.setCaptureElements('[data-ix="eventappear"]')
.capture('plain', function(actions) {
actions.waitForElementToShow('[data-ix="eventappear"]', 30000)
});
});
Console log:
~/Projects/test$ gemini update
WARNING
Running local gemini from /Users/dante/Projects/test/node_modules/gemini
Version: 4.11.0
Global: 4.9.0
✘ dev2dev plain [PhantomJS]
Area with css selector : [data-ix="eventappear"] is hidden
Total: 1 Passed: 0 Failed: 1 Skipped: 0 Retries: 0
It looks strange that error is about invisibility of element, but there is no info like not shown after 30000ms
.
@tormozz48 ☝️
@apsavin I have reproduced your case on my localhost.
Hi all. Any solution to this problem?
Is there any workaround for this issue? Having it as well
☝️ Also having this problem.. =\
Can you provide some minimal-case html page to test? I've tried many different combinations of how element should appear and still can't reproduce this error locally.
Same issue I am facing . Area with css selector : .headerimage-component is hidden Total: 1 Passed: 0 Failed: 1 Skipped: 0 Retries: 0
Any work around for this. ?