1# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from page_sets.system_health import platforms
6from page_sets.system_health import story_tags
7from page_sets.system_health import system_health_story
8
9from page_sets.login_helpers import dropbox_login
10from page_sets.login_helpers import facebook_login
11from page_sets.login_helpers import google_login
12
13from page_sets.helpers import override_online
14
15from telemetry.util import js_template
16
17
18class _LoadingStory(system_health_story.SystemHealthStory):
19  """Abstract base class for single-page System Health user stories."""
20  ABSTRACT_STORY = True
21
22  def __init__(self,
23               story_set,
24               take_memory_measurement,
25               extra_browser_args=None):
26    super(_LoadingStory, self).__init__(story_set, take_memory_measurement,
27                                        extra_browser_args)
28    self.script_to_evaluate_on_commit = override_online.ALWAYS_ONLINE
29
30  @classmethod
31  def GenerateStoryDescription(cls):
32    return 'Load %s' % cls.URL
33
34
35################################################################################
36# Search and e-commerce.
37################################################################################
38# TODO(petrcermak): Split these into 'portal' and 'shopping' stories.
39
40
41class LoadGoogleStory2018(_LoadingStory):
42  NAME = 'load:search:google:2018'
43  URL = 'https://www.google.co.uk/search?q=pepper'
44  TAGS = [story_tags.YEAR_2018]
45
46
47class LoadBaiduStory2018(_LoadingStory):
48  NAME = 'load:search:baidu:2018'
49  URL = 'https://www.baidu.com/s?word=google'
50  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2018]
51
52
53class LoadYahooStory2018(_LoadingStory):
54  NAME = 'load:search:yahoo:2018'
55  # Use additional parameter to bypass consent screen.
56  URL = 'https://search.yahoo.com/search;_ylt=?p=google&_guc_consent_skip=1541794498'
57  TAGS = [story_tags.YEAR_2018]
58
59
60class LoadAmazonDesktopStory2018(_LoadingStory):
61  NAME = 'load:search:amazon:2018'
62  URL = 'https://www.amazon.com/s/?field-keywords=pixel'
63  TAGS = [story_tags.YEAR_2018]
64  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
65
66
67class LoadAmazonMobileStory2019(_LoadingStory):
68  NAME = 'load:search:amazon:2019'
69  URL = 'https://www.amazon.com/s/?field-keywords=pixel'
70  TAGS = [story_tags.YEAR_2019]
71  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
72
73
74class LoadTaobaoDesktopStory2018(_LoadingStory):
75  NAME = 'load:search:taobao:2018'
76  URL = 'https://world.taobao.com/'
77  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
78  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2018]
79
80
81class LoadFlipkartDesktop2018(_LoadingStory):
82  NAME = 'load:search:flipkart:2018'
83  URL = 'https://www.flipkart.com/search?q=sneakers'
84  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
85  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2018]
86
87
88class LoadTaobaoMobileStory2019(_LoadingStory):
89  NAME = 'load:search:taobao:2019'
90  URL = 'http://m.intl.taobao.com/'
91  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
92  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2019]
93
94
95class LoadYandexStory2018(_LoadingStory):
96  NAME = 'load:search:yandex:2018'
97  URL = 'https://yandex.ru/touchsearch?text=science'
98  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2018]
99
100
101class LoadEbayStory2018(_LoadingStory):
102  NAME = 'load:search:ebay:2018'
103  URL = 'https://www.ebay.com/sch/i.html?_nkw=headphones'
104  TAGS = [story_tags.YEAR_2018]
105
106
107################################################################################
108# Social networks.
109################################################################################
110
111
112class LoadTwitterMobileStory2019(_LoadingStory):
113  NAME = 'load:social:twitter:2019'
114  URL = 'https://www.twitter.com/nasa'
115  TAGS = [story_tags.YEAR_2019]
116
117  # Desktop version is already covered by
118  # 'browse:social:twitter_infinite_scroll'
119  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
120
121
122class LoadVkDesktopStory2018(_LoadingStory):
123  NAME = 'load:social:vk:2018'
124  URL = 'https://vk.com/sbeatles'
125  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
126  TAGS = [
127      story_tags.HEALTH_CHECK, story_tags.INTERNATIONAL, story_tags.YEAR_2018
128  ]
129
130
131class LoadInstagramDesktopStory2018(_LoadingStory):
132  NAME = 'load:social:instagram:2018'
133  URL = 'https://www.instagram.com/selenagomez/'
134  TAGS = [story_tags.HEALTH_CHECK, story_tags.YEAR_2018]
135  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
136
137
138class LoadInstagramMobileStory2019(_LoadingStory):
139  NAME = 'load:social:instagram:2019'
140  URL = 'https://www.instagram.com/selenagomez/'
141  TAGS = [story_tags.YEAR_2019]
142  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
143
144
145class LoadPinterestStory2019(_LoadingStory):
146  NAME = 'load:social:pinterest:2019'
147  URL = 'https://uk.pinterest.com/categories/popular/'
148  TAGS = [story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2019]
149
150
151################################################################################
152# News, discussion and knowledge portals and blogs.
153################################################################################
154
155
156class LoadBbcDesktopStory2018(_LoadingStory):
157  NAME = 'load:news:bbc:2018'
158  URL = 'https://www.bbc.co.uk/news'
159  TAGS = [story_tags.YEAR_2018]
160  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
161
162
163class LoadBbcMobileStory2019(_LoadingStory):
164  NAME = 'load:news:bbc:2019'
165  URL = 'https://www.bbc.co.uk/news'
166  TAGS = [story_tags.YEAR_2019]
167  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
168
169
170class LoadCnnStory2018(_LoadingStory):
171  NAME = 'load:news:cnn:2018'
172  URL = 'https://edition.cnn.com'
173  TAGS = [
174      story_tags.HEALTH_CHECK, story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2018
175  ]
176
177
178class LoadFlipboardDesktopStory(_LoadingStory):
179  NAME = 'load:news:flipboard'
180  URL = 'https://flipboard.com/explore'
181  TAGS = [story_tags.YEAR_2016]
182  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
183
184
185class LoadHackerNewsDesktopStory2018(_LoadingStory):
186  NAME = 'load:news:hackernews:2018'
187  URL = 'https://news.ycombinator.com'
188  TAGS = [story_tags.YEAR_2018]
189  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
190
191
192class LoadNytimesDesktopStory2018(_LoadingStory):
193  NAME = 'load:news:nytimes:2018'
194  URL = 'http://www.nytimes.com'
195  TAGS = [story_tags.YEAR_2018]
196  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
197
198
199class LoadNytimesMobileStory2019(_LoadingStory):
200  NAME = 'load:news:nytimes:2019'
201  URL = 'http://mobile.nytimes.com'
202  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
203  TAGS = [story_tags.YEAR_2019]
204
205
206class LoadQqMobileStory2019(_LoadingStory):
207  NAME = 'load:news:qq:2019'
208  URL = 'https://xw.qq.com/?f=c_news'
209  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2019]
210  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
211
212
213class LoadQqDesktopStory2018(_LoadingStory):
214  NAME = 'load:news:qq:2018'
215  URL = 'https://news.qq.com'
216  TAGS = [story_tags.INTERNATIONAL, story_tags.YEAR_2018]
217  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
218
219
220class LoadRedditDesktopStory2018(_LoadingStory):
221  NAME = 'load:news:reddit:2018'
222  URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week'
223  TAGS = [story_tags.YEAR_2018]
224  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
225
226
227class LoadRedditMobileStory2019(_LoadingStory):
228  NAME = 'load:news:reddit:2019'
229  URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week'
230  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
231  TAGS = [story_tags.YEAR_2019]
232
233
234class LoadWashingtonPostMobileStory2019(_LoadingStory):
235  NAME = 'load:news:washingtonpost:2019'
236  URL = 'https://www.washingtonpost.com/pwa'
237  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
238  TAGS = [story_tags.YEAR_2019]
239  _CONTINUE_FREE_BUTTON_SELECTOR = '.continue-btn.button.free'
240  _ACCEPT_GDPR_SELECTOR = '.agree-ckb'
241  _CONTINUE_TO_SITE_SELECTOR = '.continue-btn.button.accept-consent'
242
243  def _DidLoadDocument(self, action_runner):
244    # Close the popup window. On Nexus 9 (and probably other tables) the popup
245    # window does not have a "Close" button, instead it has only a "Send link
246    # to phone" button. So on tablets we run with the popup window open. The
247    # popup is transparent, so this is mostly an aesthetical issue.
248    has_button = action_runner.EvaluateJavaScript(
249        '!!document.querySelector({{ selector }})',
250        selector=self._CONTINUE_FREE_BUTTON_SELECTOR)
251    if has_button:
252      action_runner.ClickElement(selector=self._CONTINUE_FREE_BUTTON_SELECTOR)
253      action_runner.ScrollPageToElement(selector=self._ACCEPT_GDPR_SELECTOR)
254      action_runner.ClickElement(selector=self._ACCEPT_GDPR_SELECTOR)
255      element_function = js_template.Render(
256        'document.querySelectorAll({{ selector }})[{{ index }}]',
257        selector=self._CONTINUE_TO_SITE_SELECTOR, index=0)
258      action_runner.ClickElement(element_function=element_function)
259
260
261class LoadWikipediaStory2018(_LoadingStory):
262  NAME = 'load:news:wikipedia:2018'
263  URL = 'https://en.wikipedia.org/wiki/Science'
264  TAGS = [story_tags.EMERGING_MARKET, story_tags.YEAR_2018]
265
266
267class LoadIrctcStory2019(_LoadingStory):
268  NAME = 'load:news:irctc:2019'
269  URL = 'https://www.irctc.co.in'
270  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
271  TAGS = [story_tags.EMERGING_MARKET, story_tags.YEAR_2019]
272
273  def _Login(self, action_runner):
274    # There is an error on replay that pops up the first time. If we
275    # navigate again, the error disappears.
276    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
277    action_runner.Navigate(self.URL)
278    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
279
280################################################################################
281# Audio, images, and video.
282################################################################################
283
284
285class LoadYouTubeStory2018(_LoadingStory):
286  # No way to disable autoplay on desktop.
287  NAME = 'load:media:youtube:2018'
288  URL = 'https://www.youtube.com/watch?v=QGfhS1hfTWw&autoplay=false'
289  TAGS = [
290      story_tags.HEALTH_CHECK, story_tags.EMERGING_MARKET, story_tags.YEAR_2018
291  ]
292
293
294class LoadYouTubeLivingRoomStory2020(_LoadingStory):
295  NAME = 'load:media:youtubelivingroom:2020'
296  URL = 'https://www.youtube.com/tv#/watch?v=AIyonw6LEOs'
297  TAGS = [story_tags.HEALTH_CHECK, story_tags.YEAR_2020]
298  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
299
300
301class LoadDailymotionStory2019(_LoadingStory):
302  NAME = 'load:media:dailymotion:2019'
303  URL = ('https://www.dailymotion.com/video/x7paozv')
304  TAGS = [story_tags.YEAR_2019]
305
306
307class LoadGoogleImagesStory2018(_LoadingStory):
308  NAME = 'load:media:google_images:2018'
309  URL = 'https://www.google.co.uk/search?tbm=isch&q=love'
310  TAGS = [story_tags.YEAR_2018]
311
312
313class LoadSoundCloudStory2018(_LoadingStory):
314  # No way to disable autoplay on desktop. Album artwork doesn't load due to
315  NAME = 'load:media:soundcloud:2018'
316  URL = 'https://soundcloud.com/lifeofdesiigner/desiigner-panda'
317  TAGS = [story_tags.YEAR_2018]
318
319
320class Load9GagDesktopStory(_LoadingStory):
321  NAME = 'load:media:9gag'
322  URL = 'https://www.9gag.com/'
323  TAGS = [story_tags.YEAR_2016]
324  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
325
326
327class LoadImgurStory2018(_LoadingStory):
328  NAME = 'load:media:imgur:2018'
329  URL = 'http://imgur.com/gallery/5UlBN'
330  TAGS = [story_tags.YEAR_2018]
331
332
333class LoadFlickrStory2018(_LoadingStory):
334  NAME = 'load:media:flickr:2018'
335  URL = 'https://www.flickr.com/photos/tags/noiretblanc'
336  TAGS = [story_tags.YEAR_2018]
337
338
339class LoadFacebookPhotosMobileStory2019(_LoadingStory):
340  """Load a page of rihanna's facebook with a photo."""
341  NAME = 'load:media:facebook_photos:2019'
342  URL = (
343      'https://m.facebook.com/rihanna/photos/a.207477806675/10156574885461676/?type=3&source=54&ref=page_internal')
344  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
345  TAGS = [story_tags.EMERGING_MARKET, story_tags.YEAR_2019]
346
347
348class LoadFacebookPhotosDesktopStory2018(_LoadingStory):
349  """Load a page of rihanna's facebook with a photo."""
350  NAME = 'load:media:facebook_photos:2018'
351  URL = (
352    'https://www.facebook.com/rihanna/photos/pb.10092511675.-2207520000.1541795576./10155941787036676/?type=3&theater')
353  TAGS = [story_tags.YEAR_2018]
354  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
355
356
357class _FacebookDesktopStory(_LoadingStory):
358  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
359
360  # Page event queries.
361  VISUAL_COMPLETION_EVENT = '''
362    (window.__telemetry_observed_page_events.has(
363        "telemetry:reported_by_page:viewable"))
364  '''
365
366  # the reported_by_page:* metric.
367  EVENTS_REPORTED_BY_PAGE = '''
368    window.__telemetry_reported_page_events = {
369      'VisuallyComplete(INITIAL_LOAD)': 'telemetry:reported_by_page:viewable',
370    };
371  '''
372
373  # Patch performance.measure to get notified about metrics
374  PERFORMANCE_MEASURE_PATCH = '''
375    window.__telemetry_observed_page_events = new Set();
376    (function () {
377      let reported = window.__telemetry_reported_page_events;
378      let observed = window.__telemetry_observed_page_events;
379      let performance_measure = window.performance.measure;
380
381      window.performance.measure = function (label, options) {
382        performance_measure.call(window.performance, label, options);
383        if (reported.hasOwnProperty(label)) {
384         performance_measure.call(window.performance, reported[label], options);
385         observed.add(reported[label]);
386        }
387      }
388
389    })();
390  '''
391
392  def __init__(self, story_set, take_memory_measurement):
393    super(_FacebookDesktopStory, self).__init__(story_set,
394                                                take_memory_measurement)
395    self.script_to_evaluate_on_commit += "\n"
396    self.script_to_evaluate_on_commit += js_template.Render(
397        '''{{@events_reported_by_page}}
398        {{@performance_measure}}''',
399        events_reported_by_page=self.EVENTS_REPORTED_BY_PAGE,
400        performance_measure=self.PERFORMANCE_MEASURE_PATCH)
401
402  def _DidLoadDocument(self, action_runner):
403    action_runner.WaitForJavaScriptCondition(self.VISUAL_COMPLETION_EVENT)
404
405
406class LoadFacebookPhotosDesktopStory2020(_FacebookDesktopStory):
407  """Load a page of rihanna's facebook with a photo."""
408  NAME = 'load:media:facebook_photos:desktop:2020'
409  URL = (
410      'https://www.facebook.com/rihanna/photos/pb.10092511675.-2207520000.1541795576./10155941787036676/?type=3&theater'
411  )
412  TAGS = [story_tags.YEAR_2020]
413
414  def _Login(self, action_runner):
415    facebook_login.LoginWithDesktopSite(action_runner, 'facebook4')
416
417
418class LoadFacebookFeedDesktopStory2020(_FacebookDesktopStory):
419  """Load facebook main page"""
420  NAME = 'load:media:facebook_feed:desktop:2020'
421  URL = 'https://www.facebook.com/'
422  TAGS = [story_tags.YEAR_2020]
423
424  def _Login(self, action_runner):
425    facebook_login.LoginWithDesktopSite(action_runner, 'facebook4')
426
427
428class LoadFacebookPhotosMobileStory2020(_LoadingStory):
429  """Load a page of rihanna's facebook with a photo."""
430  NAME = 'load:media:facebook_photos:mobile:2020'
431  URL = (
432      'https://m.facebook.com/rihanna/photos/pb.10092511675.-2207520000.1541795576./10155941787036676/'
433  )
434  TAGS = [story_tags.YEAR_2020]
435  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
436
437  def _Login(self, action_runner):
438    facebook_login.LoginWithMobileSite(action_runner, 'facebook4')
439
440
441class LoadFacebookFeedMobileStory2020(_LoadingStory):
442  """Load a page of national park"""
443  NAME = 'load:media:facebook_feed:mobile:2020'
444  URL = ('https://www.facebook.com/')
445  TAGS = [story_tags.YEAR_2020]
446  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
447
448  def _Login(self, action_runner):
449    facebook_login.LoginWithMobileSite(action_runner, 'facebook4')
450
451
452################################################################################
453# Online tools (documents, emails, storage, ...).
454################################################################################
455
456
457class LoadDocsStory2019(_LoadingStory):
458  """Load a typical google doc page (2019)."""
459  NAME = 'load:tools:docs:2019'
460  URL = (
461      'https://docs.google.com/document/d/1GvzDP-tTLmJ0myRhUAfTYWs3ZUFilUICg8psNHyccwQ/edit?usp=sharing')
462  TAGS = [story_tags.YEAR_2019]
463
464
465class _LoadGmailBaseStory(_LoadingStory):
466  NAME = 'load:tools:gmail'
467  URL = 'https://mail.google.com/mail/'
468  ABSTRACT_STORY = True
469
470  def _Login(self, action_runner):
471    google_login.LoginGoogleAccount(action_runner, 'googletest')
472
473    # Navigating to https://mail.google.com immediately leads to an infinite
474    # redirection loop due to a bug in WPR (see
475    # https://github.com/chromium/web-page-replay/issues/70). We therefore first
476    # navigate to a sub-URL to set up the session and hit the resulting
477    # redirection loop. Afterwards, we can safely navigate to
478    # https://mail.google.com.
479    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
480    action_runner.Navigate(
481        'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop')
482    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
483
484
485class LoadGmailStory2019(_LoadingStory):
486  NAME = 'load:tools:gmail:2019'
487  # Needs to be http and not https.
488  URL = 'http://mail.google.com/'
489  TAGS = [story_tags.HEALTH_CHECK, story_tags.YEAR_2019]
490  SKIP_LOGIN = False
491
492  def _Login(self, action_runner):
493    google_login.NewLoginGoogleAccount(action_runner, 'googletest')
494
495    # Navigating to http://mail.google.com immediately leads to an infinite
496    # redirection loop due to a bug in WPR (see
497    # https://bugs.chromium.org/p/chromium/issues/detail?id=1036791). We
498    # therefore first navigate to a dummy sub-URL to set up the session and
499    # hit the resulting redirection loop. Afterwards, we can safely navigate
500    # to http://mail.google.com.
501    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
502    action_runner.Navigate(
503        'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop')
504    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
505
506
507class LoadChatStory2020(_LoadingStory):
508  NAME = 'load:tools:chat:2020'
509  # Needs to be http and not https.
510  URL = 'http://chat.google.com/'
511  TAGS = [story_tags.YEAR_2020]
512  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
513  SKIP_LOGIN = False
514
515  def _Login(self, action_runner):
516    google_login.NewLoginGoogleAccount(action_runner, 'chatfeature')
517    action_runner.tab.WaitForDocumentReadyStateToBeComplete()
518
519
520
521class LoadStackOverflowStory2018(_LoadingStory):
522  """Load a typical question & answer page of stackoverflow.com"""
523  NAME = 'load:tools:stackoverflow:2018'
524  URL = (
525      'https://stackoverflow.com/questions/36827659/compiling-an-application-for-use-in-highly-radioactive-environments')
526  TAGS = [story_tags.YEAR_2018]
527
528
529class LoadDropboxStory2019(_LoadingStory):
530  NAME = 'load:tools:dropbox:2019'
531  URL = 'https://www.dropbox.com/'
532  TAGS = [story_tags.YEAR_2019]
533  # Desktop fails to log in
534  SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
535  SKIP_LOGIN = False
536
537  def _Login(self, action_runner):
538    dropbox_login.LoginAccount(action_runner, 'dropbox')
539
540
541class LoadWeatherStory2019(_LoadingStory):
542  NAME = 'load:tools:weather:2019'
543  URL = 'https://weather.com/en-GB/weather/today/l/USCA0286:1:US'
544  TAGS = [
545      story_tags.HEALTH_CHECK, story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2019
546  ]
547
548
549class LoadDriveStory2019(_LoadingStory):
550  NAME = 'load:tools:drive:2019'
551  URL = 'https://drive.google.com/drive/my-drive'
552  TAGS = [story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2019]
553
554  def _Login(self, action_runner):
555    google_login.NewLoginGoogleAccount(action_runner, 'googletest')
556
557
558################################################################################
559# In-browser games (HTML5 and Flash).
560################################################################################
561
562
563class LoadBubblesStory2020(_LoadingStory):
564  """Load "smarty bubbles" game on famobi.com"""
565  NAME = 'load:games:bubbles:2020'
566  URL = (
567      'https://games.cdn.famobi.com/html5games/s/smarty-bubbles/v010/?fg_domain=play.famobi.com&fg_uid=d8f24956-dc91-4902-9096-a46cb1353b6f&fg_pid=4638e320-4444-4514-81c4-d80a8c662371&fg_beat=620')
568  TAGS = [story_tags.YEAR_2020]
569
570
571class LoadLazorsStory(_LoadingStory):
572  NAME = 'load:games:lazors'
573  # Using "https://" hangs and shows "This site can't be reached".
574  URL = 'http://www8.games.mobi/games/html5/lazors/lazors.html'
575  TAGS = [story_tags.YEAR_2016]
576
577
578class LoadSpyChaseStory2018(_LoadingStory):
579  NAME = 'load:games:spychase:2018'
580  # Using "https://" shows "Your connection is not private".
581  URL = 'http://playstar.mobi/games/spychase/index.php'
582  TAGS = [story_tags.YEAR_2018]
583
584  def _DidLoadDocument(self, action_runner):
585    # The background of the game canvas is set when the "Tap screen to play"
586    # caption is displayed.
587    action_runner.WaitForJavaScriptCondition(
588        'document.querySelector("#game canvas").style.background !== ""')
589
590
591class LoadMiniclipStory2018(_LoadingStory):
592  NAME = 'load:games:miniclip:2018'
593  # Using "https://" causes "404 Not Found" during WPR recording.
594  URL = 'http://www.miniclip.com/games/en/'
595  TAGS = [story_tags.YEAR_2018]
596  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash.
597
598
599class LoadAlphabettyStory2018(_LoadingStory):
600  NAME = 'load:games:alphabetty:2018'
601  URL = 'https://king.com/play/alphabetty'
602  TAGS = [story_tags.YEAR_2018]
603  SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY  # Requires Flash.
604