2
據我所知open()
和waitFor()
需要以下步驟被包裹在then()
:我需要在then()中包裝更多的waitFor()步驟嗎?
casper.click(x('//button[text()="Login"]'));
casper.waitForSelector(x('//span[text()="Navigation"]]'));
casper.capture('1.png');
casper.then(function() {
casper.capture('2.png'); // Only this shows the navigation
});
當我有多個waitFor()
步驟,我需要把它們連自己還是他們自己的連鎖?
casper.click(x('//button[text()="Login"]'));
casper.waitForSelector(x('//span[text()="Navigation"]]'));
casper.waitWhileSelector(x('//span[text()="Loading"]]'));
casper.then(function() {
casper.capture('1.png'); // Under which condition will this be executed?
});