fix remaining test

pull/2566/head
Ayrat Badykov 5 years ago
parent 004921c3ff
commit 2cb60eaaca
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 12
      apps/block_scout_web/test/block_scout_web/features/address_contract_verification_test.exs
  2. 4
      apps/block_scout_web/test/block_scout_web/features/pages/contract_verify_page.ex

@ -49,17 +49,19 @@ defmodule BlockScoutWeb.AddressContractVerificationTest do
test "with invalid data shows error messages", %{session: session, bypass: bypass} do
Bypass.expect(bypass, fn conn -> Conn.resp(conn, 200, solc_bin_versions()) end)
address = insert(:address)
session
|> ContractVerifyPage.visit_page("0x1e0eaa06d02f965be2dfe0bc9ff52b2d82133461")
|> ContractVerifyPage.visit_page(address)
|> ContractVerifyPage.fill_form(%{
contract_name: "",
version: nil,
optimization: nil,
contract_name: "name",
version: "default",
optimization: "true",
source_code: "",
evm_version: "byzantium"
})
|> ContractVerifyPage.verify_and_publish()
|> assert_has(ContractVerifyPage.validation_error())
|> ContractVerifyPage.has_message?("There was an error validating your contract, please try again.")
end
defp solc_bin_versions do

@ -48,6 +48,10 @@ defmodule BlockScoutWeb.ContractVerifyPage do
css("[data-test='contract-source-code-error']")
end
def has_message?(session, message) do
String.contains?(page_source(session), message)
end
def verify_and_publish(session) do
click(session, button("Verify & publish"))
end

Loading…
Cancel
Save