Add contract verification e2e

pull/5361/head
aniket-engg 3 weeks ago committed by Aniket
parent b7b4d4ed70
commit 10b6c0eda4
  1. 1
      apps/contract-verification/src/app/components/NavMenu.tsx
  2. 2
      apps/contract-verification/src/app/layouts/Default.tsx
  3. 2
      apps/contract-verification/src/app/views/ReceiptsView.tsx
  4. 38
      apps/remix-ide-e2e/src/tests/contract_verification.test.ts

@ -10,6 +10,7 @@ interface NavItemProps {
const NavItem: React.FC<NavItemProps> = ({ to, icon, title }) => { const NavItem: React.FC<NavItemProps> = ({ to, icon, title }) => {
return ( return (
<NavLink <NavLink
data-id={`${title}Tab`}
to={to} to={to}
className={({ isActive }) => 'text-decoration-none d-flex px-1 py-1 flex-column justify-content-center small ' + (isActive ? "bg-light border-top border-left border-right" : "border-0 bg-transparent")} className={({ isActive }) => 'text-decoration-none d-flex px-1 py-1 flex-column justify-content-center small ' + (isActive ? "bg-light border-top border-left border-right" : "border-0 bg-transparent")}
> >

@ -13,7 +13,7 @@ export const DefaultLayout = ({ children, title, description }: PropsWithChildre
<div className="d-flex flex-column h-100"> <div className="d-flex flex-column h-100">
<NavMenu /> <NavMenu />
<div className="py-4 px-3 flex-grow-1 bg-light" style={{ overflowY: 'auto' }}> <div className="py-4 px-3 flex-grow-1 bg-light" style={{ overflowY: 'auto' }}>
<div> <div data-id={`${title}Description`}>
<p className="text-center" style={{ fontSize: '0.8rem' }}> <p className="text-center" style={{ fontSize: '0.8rem' }}>
{description} {description}
</p> </p>

@ -10,7 +10,7 @@ export const ReceiptsView = () => {
<div> <div>
{contracts.length > 0 ? contracts.map((contract, index) => ( {contracts.length > 0 ? contracts.map((contract, index) => (
<AccordionReceipt contract={contract} index={index} /> <AccordionReceipt contract={contract} index={index} />
)) : <div className="text-center mt-5">No contracts submitted for verification</div>} )) : <div className="text-center mt-5" data-id="noContractsSubmitted">No contracts submitted for verification</div>}
</div> </div>
) )
} }

@ -0,0 +1,38 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
declare global {
interface Window { testplugin: { name: string, url: string }; }
}
const tests = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null)
},
'Should load contract verification plugin #group1': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('pluginManager')
.scrollAndClick('[data-id="pluginManagerComponentActivateButtoncontract-verification"]')
.clickLaunchIcon('contract-verification')
.pause(5000)
.frame(0)
.waitForElementVisible('*[data-id="VerifyDescription"]')
},
'Should select a chain by searching #group1': function (browser: NightwatchBrowser) {
browser
.click('[data-id="chainDropdownbox"]')
.sendKeys('[data-id="chainDropdownbox"]', 's')
.sendKeys('[data-id="chainDropdownbox"]', 'c')
.sendKeys('[data-id="chainDropdownbox"]', 'r')
.click('[data-id="534351"]')
.assert.attributeContains('[data-id="chainDropdownbox"]', 'value', "Scroll Sepolia Testnet (534351)")
}
}
module.exports = {
...tests
};
Loading…
Cancel
Save