Example usage for org.openqa.selenium.html5 AppCacheStatus IDLE

List of usage examples for org.openqa.selenium.html5 AppCacheStatus IDLE

Introduction

In this page you can find the example usage for org.openqa.selenium.html5 AppCacheStatus IDLE.

Prototype

AppCacheStatus IDLE

To view the source code for org.openqa.selenium.html5 AppCacheStatus IDLE.

Click Source Link

Usage

From source file:org.auraframework.integration.test.http.AppCacheResourcesLoggingUITest.java

License:Apache License

/**
 * Opening cached app will only query server for the manifest.
 *
 * BrowserType.SAFARI is disabled: W-2367702
 *///from  w ww .  j  a v a 2  s.c  om
@TargetBrowsers({ BrowserType.GOOGLECHROME, BrowserType.IPAD, BrowserType.IPHONE })
@Test
@Ignore("W-3320758") // expected set on reload is wrong + what browser requests appears to be wrong. this needs fixing.
public void _testNoChanges() throws Exception {
    AppDescription app = new AppDescription();
    List<Request> logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, "", TOKEN, true);
    assertRequests(getExpectedInitialRequests(app), logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);

    // only expect a fetch for the manifest and the initAsync component load
    logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, "", TOKEN, true);
    List<Request> expected = Lists.newArrayList(new Request("/auraResource", "manifest", 200));
    assertRequests(expected, logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);
}

From source file:org.auraframework.integration.test.http.AppCacheResourcesLoggingUITest.java

License:Apache License

/**
 * Opening cached app after namespace style change will trigger cache update.
 *//*  w  w w.  j a  v  a  2  s . c o  m*/
@TargetBrowsers({ BrowserType.GOOGLECHROME, BrowserType.SAFARI, BrowserType.IPAD, BrowserType.IPHONE })
@ThreadHostileTest("changing component")
@Flapper
@Test
public void testComponentCssChange() throws Exception {
    AppDescription app = new AppDescription();
    String src_style = ".THIS {background-image: url('/auraFW/resources/qa/images/s.gif?@@@TOKEN@@@');}";
    DefDescriptor<StyleDef> styleDesc = createDef(StyleDef.class,
            String.format("%s://%s.%s", DefDescriptor.CSS_PREFIX, app.namespace, app.cmpName), src_style);

    List<Request> logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, TOKEN, TOKEN, true);

    Request sGif = new Request("/auraFW/resources/qa/images/s.gif", null, 200);
    List<Request> expectedInitialRequests = Lists.newArrayList(getExpectedInitialRequests(app));
    expectedInitialRequests.add(sGif);
    assertRequests(expectedInitialRequests, logs);

    assertAppCacheStatus(AppCacheStatus.IDLE);

    // update a component's css file
    String replacement = getName() + System.currentTimeMillis();
    updateStringSource(styleDesc, src_style.replace(TOKEN, replacement));

    logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, replacement, TOKEN, true);

    List<Request> expectedChangeRequests = Lists.newArrayList(getExpectedChangeRequests(app));
    expectedChangeRequests.add(sGif);
    assertRequests(expectedChangeRequests, logs);

    assertAppCacheStatus(AppCacheStatus.IDLE);
}

From source file:org.auraframework.integration.test.http.AppCacheResourcesLoggingUITest.java

License:Apache License

/**
 * Opening cached app after namespace controller change will trigger cache update. TODO(W-2955424) : un-comment the
 * last 4 lines, and update what we should be expecting.
 *//*from w w w. ja  v a2s  . c o  m*/
@TargetBrowsers({ BrowserType.GOOGLECHROME, BrowserType.SAFARI, BrowserType.IPAD, BrowserType.IPHONE })
@ThreadHostileTest("changing component")
@Flapper
@Test
public void testComponentJsChange() throws Exception {
    AppDescription app = new AppDescription();
    List<Request> logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, "", TOKEN, true);
    assertRequests(getExpectedInitialRequests(app), logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);
    // update a component's js controller file
    String replacement = getName() + System.currentTimeMillis();
    updateStringSource(app.controllerDesc, SRC_CONTROLLER.replace(TOKEN, replacement));
    logs = loadMonitorAndValidateApp(app, TOKEN, replacement, "", TOKEN, true);
    assertRequests(getExpectedChangeRequests(app), logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);
}

From source file:org.auraframework.integration.test.http.AppCacheResourcesLoggingUITest.java

License:Apache License

/**
 * Opening cached app after component markup change will trigger cache update. TODO(W-2955424) : un-comment the last
 * 4 lines, and update what we should be expecting.
 *///from  w  w  w  .  j  av  a2 s . c o m
@TargetBrowsers({ BrowserType.GOOGLECHROME, BrowserType.SAFARI, BrowserType.IPAD, BrowserType.IPHONE })
@ThreadHostileTest("depends on cache state")
@Test
public void testComponentMarkupChange() throws Exception {
    AppDescription app = new AppDescription();
    List<Request> logs = loadMonitorAndValidateApp(app, TOKEN, TOKEN, "", TOKEN, true);
    assertRequests(getExpectedInitialRequests(app), logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);
    // update markup of namespaced component used by app
    String replacement = getName() + System.currentTimeMillis();
    updateStringSource(app.cmpDesc, SRC_COMPONENT.replace(TOKEN, replacement));
    logs = loadMonitorAndValidateApp(app, replacement, TOKEN, "", TOKEN, true);
    assertRequests(getExpectedChangeRequests(app), logs);
    assertAppCacheStatus(AppCacheStatus.IDLE);
}