package com.demo.simulations;


import com.demo.utils.ApplicationEndPoints;
import com.demo.utils.ConfigReader;
import io.gatling.javaapi.core.ScenarioBuilder;
import io.gatling.javaapi.core.Simulation;

import java.io.IOException;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;
import static io.gatling.javaapi.http.HttpDsl.status;


public class CartsPageSimulation extends Simulation {

ScenarioBuilder cartsPageScenario=scenario("Cart Page Load Test")
                                      .exec(http("cart page scenario")
                                              .get(ApplicationEndPoints.CART_END_POINT).check(status().is(200)));


        {
            try {
                setUp(cartsPageScenario.injectOpen(rampUsers(new ConfigReader().getRampUPCount()).during(new ConfigReader().getRampupDuration())).protocols(new BaseSimulation().baseInitialization()));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }


        }


}
