package springboot.example01;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.Proxy.ProxyType;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;

import util.page.prometheus.MainGraphPage;
import util.page.springapplication.SpringApplicationMainPage;
import util.page.springapplication.SpringApplicationMetricsPage;

public class Example00 {
	
	private static WebDriver driver;
	
	private static WebDriver getWebDriver() {
		System.setProperty(
				"webdriver.gecko.driver",
				"C:\\Users\\fr17649\\Desktop\\presentations\\Selenium-2016-11-29\\driver\\geckodriver-v0.16.1-win64\\geckodriver.exe");

		FirefoxProfile ff = new FirefoxProfile();
		ff.setPreference("network.proxy.type", ProxyType.AUTODETECT.ordinal());
		driver = new FirefoxDriver(ff);
		
		return driver;
	}
	
	public static void sleep() {
		try {
			TimeUnit.SECONDS.sleep(5);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		System.out.println("Start demo spring boot application 01");
		driver = getWebDriver();
		
		//show spring boot main page
		new SpringApplicationMainPage(driver);
		sleep();		
		
		//show prometheus page
		MainGraphPage page = new MainGraphPage(driver);
		sleep();
		page.getTargetsPage();
		sleep();
		
		page = new MainGraphPage(driver);
		sleep();
		page.getAlerts();
		sleep();
		
		//to complete add grafana page
		//login
		//add datasource prometheus
		
		//end page
		driver.close();
		System.out.println("End demo spring boot application 01");
	}

}

@@ -1111,25 +1111,25 @@
 pplication 0
-1
+0
 %22);%0A%09%09driver
@@ -1448,18 +1448,53 @@
 %0A%09%09%0A%09%09//
-to
+TODO add prometheus graph%0A%09%09%0A%09%09//TODO
  complet
@@ -1642,17 +1642,17 @@
 cation 0
-1
+0
 %22);%0A%09%7D%0A%0A

complete example00