Skip to content

Commit dc5aaaf

Browse files
committed
add more API calls
1 parent 7e5d0e3 commit dc5aaaf

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,69 @@ Gets a list of available (physical) devices you can test on
6363
@api.get_available_devices
6464
```
6565

66+
### get_team
67+
Gets info about the current team you belong to
68+
69+
```ruby
70+
@api.get_team
71+
```
72+
73+
### get_users_in_team
74+
Gets all users in your team
75+
76+
```ruby
77+
@api.get_users_in_team(offset = 0, count = 10)
78+
```
79+
80+
### get_user_in_team
81+
Get info about a specific user in your team
82+
83+
```ruby
84+
@api.get_user_in_team(user_id)
85+
```
86+
87+
### create_user_in_team
88+
Add a user to your current team. You need to have ADMIN rights to do this.
89+
90+
```ruby
91+
@api.create_user_in_team(user = {})
92+
```
93+
94+
### update_user_in_team
95+
Updates a specific user in your team.
96+
97+
```ruby
98+
@api.update_user_in_team(user_id, user = {})
99+
```
100+
101+
### reset_credentials
102+
Resets the credentials for a specific user
103+
104+
```ruby
105+
@api.reset_credentials(user_id)
106+
```
107+
108+
### take_screenshots
109+
Take screenshots for a specific URL on specific browsers
110+
111+
```ruby
112+
@api.take_screenshots(configuration)
113+
```
114+
115+
### get_screenshots_history
116+
Retrieve screenshots that were previously generated
117+
118+
```ruby
119+
@api.get_screenshots_history(offset = 0, count = 10)
120+
```
121+
122+
### get_screenshots
123+
Get screenshots from a specific id
124+
125+
```ruby
126+
@api.get_screenshots(screenshots_id)
127+
```
128+
66129
### get_user_info
67130
Gets your user information
68131

lib/testingbot/api.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ def get_available_devices
5151
get("/devices/available")
5252
end
5353

54+
def get_team
55+
get("/team-management")
56+
end
57+
58+
def get_users_in_team(offset = 0, count = 10)
59+
get("/team-management/users?offset=#{offset}&count=#{count}")
60+
end
61+
62+
def get_user_in_team(user_id)
63+
get("/team-management/users/#{user_id}")
64+
end
65+
66+
def create_user_in_team(user = {})
67+
post("/team-management/users/", user)
68+
end
69+
70+
def update_user_in_team(user_id, user = {})
71+
put("/team-management/users/#{user_id}", user)
72+
end
73+
74+
def reset_credentials(user_id)
75+
post("/team-management/users/#{user_id}/reset-keys")
76+
end
77+
5478
def update_user_info(params = {})
5579
new_params = {}
5680
params.keys.each do |key|
@@ -99,6 +123,18 @@ def delete_build(build_identifier)
99123
delete("/builds/#{build_identifier}")
100124
end
101125

126+
def take_screenshots(configuration)
127+
post("/screenshots", configuration)
128+
end
129+
130+
def get_screenshots_history(offset = 0, count = 10)
131+
get("/screenshots?offset=#{offset}&count=#{count}")
132+
end
133+
134+
def get_screenshots(screenshots_id)
135+
get("/screenshots/#{screenshots_id}")
136+
end
137+
102138
def get_tunnels
103139
get("/tunnel/list")
104140
end

0 commit comments

Comments
 (0)