-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignupAPI.java
47 lines (31 loc) · 1.33 KB
/
SignupAPI.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package API;
import static io.restassured.RestAssured.given;
import java.net.MalformedURLException;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
public class SignupAPI extends SignupPostBase {
@Test (priority=0)
//creating a get API to Signup page using valid credentials
public void api_post01() throws MalformedURLException
{
RestAssured.baseURI = Base_URI();
given().log().all()
.queryParam("access_token","Zx2EE58K0tyzL8V4Xh7GLYYhQzHcz7Q05jrRXAcfw1").queryParam("captcha_token", "")
.header("platform", "web").header("user-agent", "wTRGdmtTaDUzdCDD")
.contentType(ContentType.JSON)
.body("SignupPostBase.Registeruser()")
.when().post("v3/users/access_student_create").then().log().all().assertThat().statusCode(200);
}
//creating a get API to Signup page using same email
public void api_post02() throws MalformedURLException
{
RestAssured.baseURI = Base_URI();
given().log().all()
.queryParam("access_token","Zx2EE58K0tyzL8V4Xh7GLYYhQzHcz7Q05jrRXAcfw1").queryParam("captcha_token", "")
.header("platform", "web").header("user-agent", "wTRGdmtTaDUzdCDD")
.contentType(ContentType.JSON)
.body("SignupPostBase.SameEmail()")
.when().post("v3/users/access_student_create").then().log().all().assertThat().statusCode(200);
}
}