/** * Creates a new context for the given webdriver, configuration and qualifier. * <strong>When you create the context, you are responsible to invoke {@link #removeContextFor(java.lang.Class) } * after the context is no longer valid.</strong> * * @return created context * @see #getContextFor(java.lang.Class) * @see #removeContextFor(java.lang.Class) */ @Override public GrapheneContext setContextFor(GrapheneConfiguration configuration, WebDriver driver, Class<?> qualifier) { GrapheneContext grapheneContext = new GrapheneContextImpl(configuration, driver, qualifier); ALL_CONTEXTS.get().put(qualifier, grapheneContext); return getContextFor(qualifier); }
/** * Creates a new context for the given webdriver, configuration and qualifier. * <strong>When you create the context, you are responsible to invoke {@link #removeContextFor(java.lang.Class) } * after the context is no longer valid.</strong> * * @return created context * @see #getContextFor(java.lang.Class) * @see #removeContextFor(java.lang.Class) */ @Override public GrapheneContext setContextFor(GrapheneConfiguration configuration, WebDriver driver, Class<?> qualifier) { GrapheneContext grapheneContext = new GrapheneContextImpl(configuration, driver, qualifier); ALL_CONTEXTS.get().put(qualifier, grapheneContext); return getContextFor(qualifier); }