Comments (3)
Hey @srinivasbudh!
Since it's Protractor managing the state of the browser, it's also responsible for starting it up.
What this means is that the task to Open
simply navigates to a specific page once the browser is already up and running.
In your case you could simply write:
describe('Navigation', function() {
const chris = Actor.named('Chris').whoCan(BrowseTheWeb.using(protractor.browser));
it('allows the actor to use a deep link', () => chris.attemptsTo(
Open.browserOn('https://google.com'),
Open.browserOn('http://example.com'),
));
});
and this would navigate between the two pages.
Having said that, you could also have your own Navigate.to
interaction, so that the report does't say that the actor "opens the browser", but "navigates to a url":
export class Navigate implements Interaction {
static to = (url: string) => new Navigate(url);
@step('{0} navigate to "#targetUrl"', ActivityType.Interaction)
performAs(actor: UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).get(this.targetUrl);
}
constructor(private targetUrl: string) { }
}
Does this help?
J
from serenity-js.
Hi,
Thanks a lot I was trying the first solution and I was facing error Webdriver has quit unexpectedly, I am able to use the second solution suggested above. Thanks for the solution.
from serenity-js.
The behaviour of both implementations is the same actually (they both call protractor.browser.get(url)
under the hood), the only difference it how they're reported (the @step
annotation).
Glad it helped :-)
J
from serenity-js.
Related Issues (20)
- Serenity/JS should provide a way to pass custom scroll options to the `scrollIntoView()` method HOT 10
- Some report customization properties in `serenity.properties` not picked up HOT 1
- Running tests from serenity-js-cucumber-webdriverio template on Windows gives ERR_UNSUPPORTED_ESM_URL_SCHEME error HOT 1
- Serenity/JS should announce tags on playwright test name automatically
- Step definations not being inferred when using ESNext modules
- Serenity/JS should allow for uploading files
- Serenity/JS should support drag and drop interactions
- Serenity/JS should make it easier to configure CA certifactes for Axios client used with the CallAnApi ability
- Upgrading to Serenity Js3 HOT 1
- Serenity/JS should allow to hide sensitive information in report HOT 5
- Serenity/JS should allow to attach files or other attachments to test cases and show them in the html report HOT 1
- Serenity/JS should contain templates with Selenium HOT 1
- Serenity/JS docs should explain how to set window size when using Playwright without Playwright Test
- Serenity/JS should have a "Community" page
- Serenity/JS should automatically propose updates when they're available
- SerenityBDD report still contains dead links in nested spec structures HOT 1
- Serenity/JS should provide the actual value of a note in reports HOT 2
- Serenity/JS Github main README.md - Deadlink to playwright-test in handbook HOT 1
- Serenity Console reporter improvements HOT 10
- How to create a question that would Round number and convert to string.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serenity-js.