How to use the @flood/element.step function in @flood/element

To help you get started, we’ve selected a few @flood/element examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flood-io / element / examples / sap-fiori / 09-walkthrough / walkthrough1.ts View on Github external
const page = browser.page

    let obj_txt_SayHello = By.css('#__input0-inner')
    await browser.wait(Until.elementIsVisible(obj_txt_SayHello))
    await page.focus( '#__input0-inner' );
    await page.keyboard.press( 'End' );    
    page.type('#__input0-inner', ' Flood Element 123', {delay: 200}); // Types slower, like a user 

    let obj_lbl_CustomText = By.xpath("//div[contains(text(),'World Flood Element 123')]")
    await browser.wait(Until.elementIsVisible(obj_lbl_CustomText))    

    await browser.takeScreenshot()
  })

  step('Walkthrough Demo App: Select Invoice Item', async browser => {

    let obj_span_milk = By.xpath("//span[contains(text(),'Canned Beans')]")
    await browser.wait(Until.elementIsVisible(obj_span_milk))
    let element1 = await browser.findElement(obj_span_milk)
    await element1.click() 

    //Please rate this product
    const pageTextVerify = By.visibleText('Please rate this product')
    await browser.wait(Until.elementIsVisible(pageTextVerify))  

    await browser.takeScreenshot()
  })
github flood-io / element / smoke / test-scripts / googling-test-data.pass.ts View on Github external
console.log('finding elt')
		let searchInput = await browser.findElement(By.nameAttr('q'))

		console.log('highlighting')
		await browser.highlightElement(searchInput)
		await browser.takeScreenshot()

		console.log('typing')
		await searchInput.sendKeys(row.query, Key.RETURN)

		await browser.wait(Until.titleIs(`${row.query} - Google Search`))
		await browser.takeScreenshot()
	})

	step('click first result', async (browser: Browser, data: any) => {
		let firstResultLink = await browser.findElement(By.attr('a', 'href', data.href))
		await firstResultLink.click()
		await browser.waitForNavigation()
		await browser.takeScreenshot()
	})
}
github flood-io / element / examples / jira / jira-element.ts View on Github external
await browser.wait(Until.elementIsVisible(pageTextVerify))

		await browser.takeScreenshot()
	})

	step('JIRA: Click jira-load-test project', async browser => {
		let btnProjects = await browser.findElement(By.visibleText('jira-load-test'))
		await btnProjects.click()

		let pageTextVerify = By.visibleText('Kanban board')
		await browser.wait(Until.elementIsVisible(pageTextVerify))

		await browser.takeScreenshot()
	})

	step('JIRA: Create Issue - Enter Details', async browser => {
		let btnCreate = await browser.findElement(
			By.xpath("//span[contains(@aria-label, 'Create (c)')]"),
		)
		await btnCreate.click()

		let pageTextVerify = By.visibleText('Create issue')
		await browser.wait(Until.elementIsVisible(pageTextVerify))

		await browser.takeScreenshot()

		//#issuetype-field = BUG
		let selIssueType = await browser.findElement(
			By.xpath("//input[contains(@id, 'issuetype-field')]"),
		)
		await selIssueType.focus()
github flood-io / element / examples / sap-fiori / 09-walkthrough / walkthrough1.ts View on Github external
export default () => {

  step('Walkthrough Demo App: Home', async browser => {
    await browser.visit('https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/walkthrough/38/webapp/test/mockServer.html')

    const pageTextVerify = By.visibleText('Hello World')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    await browser.takeScreenshot()
  })

  step('Walkthrough Demo App: Click Open Dialog', async browser => {
    
    //tpress the say hello with dialog button
    let obj_bdo_SayHello = By.xpath("//bdi[contains(text(),'Say Hello With Dialog')]")
    await browser.wait(Until.elementIsVisible(obj_bdo_SayHello))
    let element1 = await browser.findElement(obj_bdo_SayHello)
    await element1.click() 

    const pageTextVerify = By.visibleText("Hello World")
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    let obj_bdi_ok = By.xpath("//bdi[contains(text(),'Ok')]")
    await browser.wait(Until.elementIsVisible(obj_bdi_ok))
    let element2 = await browser.findElement(obj_bdi_ok)
    await element2.click()    

    await browser.takeScreenshot()
github flood-io / element / examples / sap-fiori / 19-apf-config-modeler / apf-config-modeler / apf-config1.ts View on Github external
step('APF Config Modeler Demo App: Select Tree Item', async browser => {
    
    //APF Standard Demo
    let obj_span_TreeAPFStandardDemo = By.xpath("//span[contains(text(),'APF Standard Demo')]")
    await browser.wait(Until.elementIsVisible(obj_span_TreeAPFStandardDemo))
    let element1 = await browser.findElement(obj_span_TreeAPFStandardDemo)
    await element1.click()  

    const pageTextVerify = By.visibleText('Configuration Data')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    await browser.takeScreenshot()
  })  

  step('APF Config Modeler Demo App: Select Currency Filter', async browser => {
    
    //Choose Filter
    let obj_span_Filters = By.xpath("//span[contains(text(),'Filters')]")
    await browser.wait(Until.elementIsVisible(obj_span_Filters))
    let element1 = await browser.findElement(obj_span_Filters)
    await element1.click()  

    await browser.wait(2)

    //Choose Currency Filter
    let obj_span_CurrencyFilter = By.xpath("//span[contains(text(),'Currency')]")
    await browser.wait(Until.elementIsVisible(obj_span_CurrencyFilter))
    let element2 = await browser.findElement(obj_span_CurrencyFilter)
    await element2.click()    

    const pageTextVerify = By.visibleText('Basic Data')
github flood-io / element / examples / sap-fiori / 03-sales-orders / salesorders1.ts View on Github external
export default () => {

  step('Sales Orders Demo App: Home', async browser => {
    await browser.visit('https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/sample.manage.products.sepmra/test/index.html#masterDetail-display')

    const pageTextVerify = By.visibleText('Products (0)')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    await browser.takeScreenshot()
  })

  step('Sales Orders Demo App: Select Supplier', async browser => {
    
    let obj_itm_Supplier = By.xpath("//span[contains(@id, 'Supplier-multiinput-vhi')]")
    await browser.wait(Until.elementIsVisible(obj_itm_Supplier))
    let element1 = await browser.findElement(obj_itm_Supplier)
    await element1.click() 

    const pageTextVerify = By.visibleText("Select Supplier")
github flood-io / element / examples / sap-fiori / 07-bulletin-board / bb1.ts View on Github external
export default () => {

  step('Bulletin Board Demo App: Home', async browser => {
    
    //Navigate to the Bulleting Board Demo Application
    await browser.visit('https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/testing/14/webapp/test/mockServer.html')

    //Verify that we are on the correct page by checking that 'Bulleting Board' text is shown on the page
    const pageTextVerify = By.visibleText('Bulletin Board')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    //Take a screenshot
    await browser.takeScreenshot()
  })

  step('Bulletin Board Demo App: Click Item', async browser => {
    
    //Search the bulletin board list and type in 'Cheap Boat'
    let obj_itm_Boat = By.xpath("//span[contains(text(),'Cheap Boat')]")
github flood-io / element / examples / sap-fiori / 06-quickstart / quickstart1.ts View on Github external
export default () => {

  step('Quickstart Demo App: Home', async browser => {

    //Navigate to the Quickstart Demo Application
    await browser.visit('https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/quickstart/03/webapp/index.html')

    //Verify that we are on the correct page by checking that 'My App' text is shown on the page
    const pageTextVerify = By.visibleText('My App')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    //Take a screenshot
    await browser.takeScreenshot()
  })

  step('Quickstart Demo App: Click Go', async browser => {
    
    //Click on the text link item called 'Go!'
    let obj_btn_Go = By.xpath("//bdi[contains(text(),'Go!')]")
    await browser.wait(Until.elementIsVisible(obj_btn_Go))
    let element1 = await browser.findElement(obj_btn_Go)
    await element1.click() 

    //Verify that we are on the correct page by checking that 'This is UI5!' text is shown on the page
    const pageTextVerify = By.visibleText("This is UI5!")
    await browser.wait(Until.elementIsVisible(pageTextVerify))  

    //Take a screenshot
    await browser.takeScreenshot()
  })

  step('Quickstart Demo App: Click Are You Ready?', async browser => {
github flood-io / element / examples / sap-fiori / 14-worklist-flp / worklist-flp1.ts View on Github external
const page = browser.page
    
    //Search worklist
    let obj_txt_SearchAnalysisType = By.xpath("//input[contains(@placeholder, 'Search')]")
    await browser.wait(Until.elementIsVisible(obj_txt_SearchAnalysisType))
    await browser.type(obj_txt_SearchAnalysisType, "Object 19")
    await page.keyboard.press('Enter')

    const pageTextVerify = By.visibleText('Object 19')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    await browser.takeScreenshot()
  })
  
  step('Worklist FLP Demo App: Select Worklist', async browser => {

    
    //Select worklist
    let obj_span_WorklistItem = By.xpath("//span[contains(text(),'Object 19')]")
    await browser.wait(Until.elementIsVisible(obj_span_WorklistItem))
    let element1 = await browser.findElement(obj_span_WorklistItem)
    await element1.click() 

    const pageTextVerify = By.visibleText('560.00')
    await browser.wait(Until.elementIsVisible(pageTextVerify))

    await browser.takeScreenshot()
  })
github flood-io / element / examples / sap-fiori / SAP4Hana_createSalesOrder.ts View on Github external
//enter password
        await browser.type(By.css('#j_password'), "YvnXh39rpjEF")

        let signin = await browser.findElement(By.css('#logOnFormSubmit'))
        await signin.click()        

    	//Validate text
    	let dashValidation = By.visibleText('Trial Center')
        await browser.wait(Until.elementIsVisible(dashValidation))          
        
        await browser.takeScreenshot()

    })
    
	step('Create Sales Order', async browser => {

    	//Validate text
    	let dashValidation = By.visibleText('Trial Center')
        await browser.wait(Until.elementIsVisible(dashValidation))    
        
        //click Create Sales Orders
        let btnCreateSalesOrders = await browser.findElement(By.xpath("//div[contains(@aria-label, 'Create Sales Orders')]"))
        await btnCreateSalesOrders.click()    

    	//Validate text
    	let salesordersValidation = By.visibleText('New Sales Order')
        await browser.wait(Until.elementIsVisible(salesordersValidation))              
        
        await browser.takeScreenshot()

    })