Skip to content

Commit cb876b0

Browse files
committed
Updated times between actions
1 parent ee8d677 commit cb876b0

File tree

2 files changed

+82
-61
lines changed

2 files changed

+82
-61
lines changed
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
2-
@{
3-
var videoList = ViewBag.VideoList as List<string>;
4-
var isLeft = ViewBag.IsLeft;
5-
}
6-
7-
@if (isLeft)
8-
{
9-
<div id="videoLeftContainer" class="video-container">
10-
<video id="leftVideo" autoplay muted disablePictureInPicture>
11-
<source src="@videoList?[0]" type="video/mp4">
12-
Your browser does not support the video tag.
13-
</video>
14-
</div>
15-
}
16-
else
17-
{
18-
<div id="videoRightContainer" class="video-container">
19-
<video id="rightVideo" autoplay muted disablePictureInPicture>
20-
<source src="@videoList?[0]" type="video/mp4">
21-
Your browser does not support the video tag.
22-
</video>
23-
</div>
24-
}
25-
26-
<script type="module">
27-
import VideoController from '/js/videoController.js';
28-
29-
const videoList = @Html.Raw(Json.Serialize(videoList));
30-
const isLeft = @Html.Raw(Json.Serialize(isLeft));
31-
32-
if(isLeft)
33-
{
34-
const leftVideoElement = document.getElementById('leftVideo');
35-
new VideoController(leftVideoElement, videoList);
36-
}
37-
else
38-
{
39-
const rightVideoElement = document.getElementById('rightVideo');
40-
new VideoController(rightVideoElement, videoList);
41-
}
42-
</script>
1+
@* *@
2+
@* @{ *@
3+
@* var videoList = ViewBag.VideoList as List<string>; *@
4+
@* var isLeft = ViewBag.IsLeft; *@
5+
@* } *@
6+
@* *@
7+
@* @if (isLeft) *@
8+
@* { *@
9+
@* <div id="videoLeftContainer" class="video-container"> *@
10+
@* <video id="leftVideo" autoplay muted disablePictureInPicture> *@
11+
@* <source src="@videoList?[0]" type="video/mp4"> *@
12+
@* Your browser does not support the video tag. *@
13+
@* </video> *@
14+
@* </div> *@
15+
@* } *@
16+
@* else *@
17+
@* { *@
18+
@* <div id="videoRightContainer" class="video-container"> *@
19+
@* <video id="rightVideo" autoplay muted disablePictureInPicture> *@
20+
@* <source src="@videoList?[0]" type="video/mp4"> *@
21+
@* Your browser does not support the video tag. *@
22+
@* </video> *@
23+
@* </div> *@
24+
@* } *@
25+
@* *@
26+
@* <script type="module"> *@
27+
@* import VideoController from '/js/videoController.js'; *@
28+
@* *@
29+
@* const videoList = @Html.Raw(Json.Serialize(videoList)); *@
30+
@* const isLeft = @Html.Raw(Json.Serialize(isLeft)); *@
31+
@* *@
32+
@* if(isLeft) *@
33+
@* { *@
34+
@* const leftVideoElement = document.getElementById('leftVideo'); *@
35+
@* new VideoController(leftVideoElement, videoList); *@
36+
@* } *@
37+
@* else *@
38+
@* { *@
39+
@* const rightVideoElement = document.getElementById('rightVideo'); *@
40+
@* new VideoController(rightVideoElement, videoList); *@
41+
@* } *@
42+
@* </script> *@

Chirp/test/PlaywrightTests/ProgramDemo.cs

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function step() {
2828
}
2929
3030
step();
31-
}", 50); // Adjust speed (in milliseconds) between steps
31+
}", 100); // Adjust speed (in milliseconds) between steps
3232
}
3333

3434
private async Task ScrollSmothlyToTop()
@@ -49,7 +49,7 @@ function step() {
4949
}
5050
5151
step();
52-
}", 50); // Adjust speed (in milliseconds) between steps
52+
}", 100); // Adjust speed (in milliseconds) between steps
5353
}
5454

5555
private async Task Register(TestAuthor testAuthor)
@@ -128,9 +128,9 @@ public async Task DemoOfNormalFeatures()
128128
.WithPassword("password")
129129
.GetTestAuthor();
130130

131-
var userToBeFolowowedByExternalUser = new TestAuthorBuilder(RazorFactory.GetUserManager())
132-
.WithUsernameAndEmail("UserToBeFolowowedByExternalUser")
133-
.GetTestAuthor();
131+
var userToBeFolowowedByMRTest = new TestAuthorBuilder(RazorFactory.GetUserManager())
132+
.WithUsernameAndEmail("UserToBeFolowowedByMRTest")
133+
.Create();
134134

135135
var mrAuthor = new TestAuthorBuilder(RazorFactory.GetUserManager())
136136
.WithUsernameAndEmail("Mr. Author")
@@ -144,26 +144,32 @@ public async Task DemoOfNormalFeatures()
144144
.WithUsernameAndEmail("RandomUser")
145145
.Create();
146146

147+
var userWhoWasFollowed = new TestAuthorBuilder(RazorFactory.GetUserManager())
148+
.WithUsernameAndEmail("UserWhoWasFollowed")
149+
.GetTestAuthor();
150+
147151

148-
userToFollowOtherUSer.AddFollow(userToBeFolowowedByExternalUser);
152+
userToFollowOtherUSer.AddFollow(userWhoWasFollowed);
149153

150154
userToFollowOtherUSer.Create();
151155

152156
var test = RazorFactory.GetDbContext().Authors.Select(a => new {a.UserName, a.Email, a.PasswordHash}).ToList();
153157

154158
await GenerateCheeps(randomUser.Author, 300, "Random message");
155-
await GenerateCheep(userToBeFolowowedByExternalUser.Author, $"Hello there people, im {userToBeFolowowedByExternalUser.UserName}");
156-
await GenerateCheep(userToBeFolowowedByExternalUser.Author, $"This is my second message");
159+
await GenerateCheep(userToBeFolowowedByMRTest.Author, $"Hello there people, im {userToBeFolowowedByMRTest.UserName}");
160+
await GenerateCheep(userToBeFolowowedByMRTest.Author, $"This is my second message");
157161
await GenerateCheep(mrAuthor.Author, "This is amazing!");
158162

159163
#endregion
160164

161165
//go to public timeline
162-
await Page.GotoAsync(RazorBaseUrl);
166+
await Page.GotoAsync("/");
167+
await Page.WaitForURLAsync($"{RazorBaseUrl}/**");
168+
Thread.Sleep(5000);
163169
//scroll to bottom
164-
await ScrollSmothlyToBottom();
170+
//await ScrollSmothlyToBottom();
165171
//scroll to top
166-
await ScrollSmothlyToTop();
172+
//await ScrollSmothlyToTop();
167173
//Register user with external login
168174
await RegisterViaExternalProvider(externalAuthor);
169175
await Page.WaitForURLAsync($"{RazorBaseUrl}/**");
@@ -180,60 +186,75 @@ public async Task DemoOfNormalFeatures()
180186
await RazorPageUtils.Login(testAuthorToRegister);
181187
//See private timeline
182188
await RazorPageUtils.GoToPrivateTimeline();
189+
Thread.Sleep(700);
183190
//Cheep From pirvate timeline
184191
await PostCheep("This is my first message!");
192+
Thread.Sleep(700);
185193
//Go to public timeline
186194
await RazorPageUtils.GoToPublicTimeline();
187195
//Cheep empty from public timeline
188196
await PostCheep("");
197+
Thread.Sleep(700);
189198
//Cheep from public timeline
190199
await PostCheep("This is my second message!");
200+
Thread.Sleep(700);
191201
//Go to private timeline
192202
await RazorPageUtils.GoToPrivateTimeline();
203+
Thread.Sleep(700);
193204
//Go to public timeline
194205
await RazorPageUtils.GoToPublicTimeline();
195206
//Follow user
196-
await FollowAuthor(userToBeFolowowedByExternalUser);
207+
await FollowAuthor(userToBeFolowowedByMRTest);
208+
Thread.Sleep(700);
197209
await FollowAuthor(mrAuthor);
210+
Thread.Sleep(700);
198211
await FollowAuthor(randomUser);
212+
Thread.Sleep(700);
199213
//Unfollow user
200214
await UnfollowAuthor(randomUser);
215+
Thread.Sleep(700);
201216
//Go to private timeline
202217
await RazorPageUtils.GoToPrivateTimeline();
203218
//Unfollow user
204-
await UnfollowAuthor(userToBeFolowowedByExternalUser);
219+
await UnfollowAuthor(userToBeFolowowedByMRTest);
220+
Thread.Sleep(700);
205221
//Refollow user
206-
await FollowAuthor(userToBeFolowowedByExternalUser);
222+
await FollowAuthor(userToBeFolowowedByMRTest);
223+
Thread.Sleep(700);
207224
//Unfollow user
208225
await UnfollowAuthor(mrAuthor);
226+
Thread.Sleep(700);
209227
//Refresh page
210228
await Page.ReloadAsync();
229+
Thread.Sleep(700);
211230
//Go to about page
212231
await GoToAboutPage();
232+
Thread.Sleep(2000);
213233
//Forget user
214234
await ForgetAuthor();
215235
//Try to login
216236
await RazorPageUtils.Login(testAuthorToRegister);
237+
Thread.Sleep(300);
217238
//login third user, who was followed by external user
218-
await RazorPageUtils.Login(userToBeFolowowedByExternalUser);
239+
await RazorPageUtils.Login(userToBeFolowowedByMRTest);
219240
//go to about me and see that there is now no followers
220241
await GoToAboutPage();
242+
Thread.Sleep(2000);
221243
//forget me
222244
await ForgetAuthor();
223245
//login 4th user
224-
await RazorPageUtils.Login(userToFollowOtherUSer);
246+
await RazorPageUtils.Login(userWhoWasFollowed);
225247
//go to about me and see that there is now no one following
226248
await GoToAboutPage();
249+
Thread.Sleep(2000);
227250
//sleep for 10 seconds
228-
// Thread.Sleep(10000);
251+
//Thread.Sleep(10000);
229252
Assert.True(true);
230253
}
231254

232255
[Test]
233256
public async Task DemoOfExtraFeatures()
234257
{
235-
236-
237258
Assert.True(true);
238259
}
239260
}

0 commit comments

Comments
 (0)