<commit_before>{-# LANGUAGE OverloadedStrings #-}
module Main where

import           Control.Concurrent
import           Control.Parallel
import Control.Monad (void)
import           Data.List
import qualified Data.Text                    as T
import           Test.WebDriver
import           Test.WebDriver.Classes
import           Test.WebDriver.Commands.Wait

capsChrome = defaultCaps { browser = chrome }
capsFF = defaultCaps

-- Have no fun with baidu but only cause it is loading fast than google in China.
--
baidu :: WD ()
baidu = openPage "http://www.baidu.com/"

searchBaidu :: WD Bool
searchBaidu = do
  searchBox <- findElem (ByName "wd")
  sendKeys "<PASSWORD>!" searchBox
  submit searchBox
  setImplicitWait 50
  waitUntil 2000 $ do
    title <- getTitle
    return ("cheese!" `T.isSuffixOf` title)<commit_msg>Baidu now has two elements with name wd<commit_after>{-# LANGUAGE OverloadedStrings #-}
module Main where

import           Control.Concurrent
import           Control.Parallel
import Control.Monad (void)
import           Data.List
import qualified Data.Text                    as T
import           Test.WebDriver
import           Test.WebDriver.Classes
import           Test.WebDriver.Commands.Wait

capsChrome = defaultCaps { browser = chrome }
capsFF = defaultCaps

-- Have no fun with baidu but only cause it is loading fast than google in China.
--
baidu :: WD ()
baidu = openPage "http://www.baidu.com/"

searchBaidu :: WD Bool
searchBaidu = do
  searchBox <- findElem (ById "kw1")
  sendKeys "Che<PASSWORD>!" searchBox
  submit searchBox
  setImplicitWait 50
  waitUntil 2000 $ do
    title <- getTitle
    return ("cheese!" `T.isSuffixOf` title)
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.007738095238095238, 'mean_word_length': 2.752232142857143, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1030941', 'n_tokens_mistral': 520, 'n_tokens_neox': 497, 'n_words': 162}