Skip to content

Instantly share code, notes, and snippets.

@Lakret
Created August 24, 2015 00:23
Show Gist options
  • Save Lakret/2e77054f8db5915d9c70 to your computer and use it in GitHub Desktop.
Save Lakret/2e77054f8db5915d9c70 to your computer and use it in GitHub Desktop.
package pages.fa_pages
import org.openqa.selenium.WebDriver
import expert_elements._
import queries._
import org.scalatest.selenium.WebBrowser
import org.scalatest._
import common._
import pages.ExpertPage
import pages.pages_constants._
class FaBalancePage[Intro <: ExpertPage, Result <: ExpertPage](url : String)(implicit val driver: WebDriver)
extends FaFormPage(url) with BreadCrumbs[Intro] with Matchers with FaIncompleteSaver with ExpertEventually with Scroller {
scrollToEnd()
lazy val inputTable = new ExpertLazyTable((id : String) => new ExpertInput(ById(id)), FaBalanceInputTableFieldsFactory())
with FaBalanceLazyTableHelper[ExpertInput]
lazy val infoTable = new ExpertLazyTable((id : String) => new ExpertText(ById(id)), FaBalanceInfoTableFieldsFactory())
with FaBalanceLazyTableHelper[ExpertText]
val inputSimplifiedTable = new ExpertLazyTable((id : String) => new ExpertInput(ById(id)), FaSimplifiedBalanceInputTableFieldsFactory())
with FaSimplifiedBalanceLazyTableHelper[ExpertInput]
val inputTable2010 = new ExpertLazyTable((id : String) => new ExpertInput(ById(id)), Fa2010BalanceInputTableFieldsFactory())
with Fa2010BalanceLazyTableHelper[ExpertInput]
val infoTable2010 = new ExpertLazyTable((id : String) => new ExpertText(ById(id)), Fa2010BalanceInfoTableFieldsFactory())
with Fa2010BalanceLazyTableHelper[ExpertText]
val wizardStepPage: String = "Бухгалтерский баланс"
protected val wizardStepPageSelector = "#balance_0710099 h1"
override def fillMinimal() = {
inputTable.fillFromMap(Map(
("1160", 0) -> "10500", ("1160", 1) -> "10500", ("1530", 0) -> "10500", ("1530", 1) -> "10500"))
}
override def accept() {
currentStep should be("Бух. баланс")
}
}
object FaBalancePage extends WebBrowser {
type DefaultType[Intro <: ExpertPage] = FaBalancePage[Intro, FaResultPage.type#DefaultType[Intro]]
implicit def FaBalancePageToConstructable[Intro <: ExpertPage, Result <: ExpertPage](implicit driver : WebDriver)
: Constructable[FaBalancePage[Intro, Result]] =
new Constructable[FaBalancePage[Intro, Result]] {
def construct = new FaBalancePage[Intro, Result](_ : String)
}
implicit def FaBalancePageToNextStep[Intro <: ExpertPage, Result <: ExpertPage]
(current : FaBalancePage[Intro, Result])(implicit driver : WebDriver) =
new FaBalancePage[Intro, Result](current.url)
with WizardNextStep[FaBalancePage[Intro, Result], FaProfitPage[Intro, Result]] {
override val nextPageConstructor = implicitly[Constructable[FaProfitPage[Intro, Result]]].construct
}
implicit def FaBalancePageToPrevStep[Intro <: ExpertPage, Result <: ExpertPage]
(current : FaBalancePage[Intro, Result])(implicit driver : WebDriver) =
new FaBalancePage[Intro, Result](current.url)
with WizardPrevStep[FaBalancePage[Intro, Result], FaCompanyInfoPage[Intro, Result]] {
override protected val prevPageConstructor = implicitly[Constructable[FaCompanyInfoPage[Intro, Result]]].construct
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment