chore(loadtests): don't manually add submittors
This commit is contained in:
parent
f2bdc007c9
commit
aa8874d941
27
load/Load.hs
27
load/Load.hs
@ -263,20 +263,21 @@ runSimulation' LoadSheetSubmission = do
|
|||||||
where formURI' = nullURI { uriPath = unpack . Text.intercalate "/" $ "." : formPath }
|
where formURI' = nullURI { uriPath = unpack . Text.intercalate "/" $ "." : formPath }
|
||||||
(formPath, _) = renderRoute $ CSheetR loadTerm loadSchool loadCourse loadSheet SubmissionNewR
|
(formPath, _) = renderRoute $ CSheetR loadTerm loadSchool loadCourse loadSheet SubmissionNewR
|
||||||
resp <- liftIO . Session.get session $ uriToString id formURI mempty
|
resp <- liftIO . Session.get session $ uriToString id formURI mempty
|
||||||
Just formData <- return . getFormData FIDsubmission $ resp ^. responseBody
|
-- Just formData <- return . getFormData FIDsubmission $ resp ^. responseBody
|
||||||
Just addButtonData <- return . flip (runFormScraper FIDsubmission) (resp ^. responseBody) $ do
|
-- Just addButtonData <- return . flip (runFormScraper FIDsubmission) (resp ^. responseBody) $ do
|
||||||
let btnSel = "button" Scalpel.@: [Scalpel.hasClass "btn-mass-input-add"]
|
-- let btnSel = "button" Scalpel.@: [Scalpel.hasClass "btn-mass-input-add"]
|
||||||
|
|
||||||
name <- Scalpel.attr "name" btnSel
|
-- name <- Scalpel.attr "name" btnSel
|
||||||
value <- Scalpel.attr "value" btnSel
|
-- value <- Scalpel.attr "value" btnSel
|
||||||
guard $ value == "add__0__0"
|
-- guard $ value == "add__0__0"
|
||||||
return $ toStrict name := value
|
-- return $ toStrict name := value
|
||||||
let miData = addButtonData : map addEmail formData
|
-- let miData = addButtonData : map addEmail formData
|
||||||
where addEmail dat@(name := _)
|
-- where addEmail dat@(name := _)
|
||||||
| "__add__0__fields__emails" `isSuffixOf` name = name := ("loadtest@example.invalid" :: Text)
|
-- | "__add__0__fields__emails" `isSuffixOf` name = name := ("loadtest@example.invalid" :: Text)
|
||||||
| otherwise = dat
|
-- | otherwise = dat
|
||||||
resp2 <- liftIO $ Session.post session (uriToString id formURI mempty) miData
|
-- resp2 <- liftIO $ Session.post session (uriToString id formURI mempty) miData
|
||||||
Just formData2 <- return . getFormData FIDsubmission $ resp2 ^. responseBody
|
-- Just formData2 <- return . getFormData FIDsubmission $ resp2 ^. responseBody
|
||||||
|
Just formData2 <- return . getFormData FIDsubmission $ resp ^. responseBody
|
||||||
uploadSeed <- liftIO seedNew
|
uploadSeed <- liftIO seedNew
|
||||||
chunkCount <- sampleIntegral loadUploadChunks
|
chunkCount <- sampleIntegral loadUploadChunks
|
||||||
chunks <- replicateM (fromIntegral chunkCount) $ sampleIntegral loadUploadChunkSize
|
chunks <- replicateM (fromIntegral chunkCount) $ sampleIntegral loadUploadChunkSize
|
||||||
|
|||||||
Reference in New Issue
Block a user