package org.auraframework.perf.test.components;

import java.net.URLEncoder;
import java.util.logging.Logger;

import org.auraframework.def.ComponentDef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.perf.core.ComponentPerfAbstractTestCase;

public final class PerfLoadComponentTest extends ComponentPerfAbstractTestCase {

    private static final Logger logger = Logger.getLogger(PerfLoadComponentTest.class.getSimpleName());

    public PerfLoadComponentTest(String name, DefDescriptor<ComponentDef> desc) {
        super(name, desc);
    }

    @Override
    public void testRun() throws Throwable {
        String relativeUrl = "/perfTest/perf.app#" +
                URLEncoder.encode("{\"componentDef\":\"" + descriptor + "\"}", "UTF-8");
        String url = getAbsoluteURI(relativeUrl).toString();
        logger.info("testRun: " + url);
        openRaw(url);
    }
}

@@ -46,70 +46,8 @@
 s;%0A%0A
-import java.net.URLEncoder;%0Aimport java.util.logging.Logger;%0A%0A
 impo
@@ -194,16 +194,109 @@
 estCase;
+%0Aimport org.openqa.selenium.By;%0A%0Aimport java.net.URLEncoder;%0Aimport java.util.logging.Logger;
 %0A%0Apublic
@@ -890,24 +890,25 @@
 : %22 + url);%0A
+%0A
         open
@@ -916,16 +916,283 @@
 aw(url);
+%0A%0A        String componentName = descriptor.getName();%0A        waitForElementAppear(%22Container div%5Bdata-app-rendered-component%5D element for thecomponent not present%22,%0A                By.cssSelector(String.format(%22%5Bdata-app-rendered-component='%25s'%5D%22, componentName)));
 %0A    %7D%0A%7D

Add a wait for component render to webdriver tests