getgauge/gauge.org

Modify generate scripts section

Closed this issue · 0 comments

zabil commented

https://gauge.org/gauge-taiko/

  • Use bash
  • Start recording from the $HOME folder
  • Remove the warning
dyld: Library not loaded: /usr/local/lib/libgdbm.4.dylib                                                                                                                          
  Referenced from: /usr/local/bin/zsh                                                                                                                                             
  Reason: image not found                                                                                                                                                         
zsh: abort    

Only have the following recorded

> .code
const { openBrowser, goto, write, click } = require('taiko');                                                                                                                     
(async () => {                                                                                                                                                                    
    try {                                                                                                                                                                         
        await openBrowser();                                                                                                                                                      
        await goto("google.com");                                                                                                                                                 
        await write("Gauge and Taiko test automation");                                                                                                                                     
        await click("Google Search");                                                                                                                                             
    } catch (e) {                                                                                                                                                                 
        console.error(e);                                                                                                                                                         
    } finally {                                                                                                                                                                   
        await closeBrowser();                                                                                                                                                     
    }                                                                                                                                                                             
})();   
> .code google.js
> .exit
$ taiko google.js

Modify the copy

On execution, Taiko generates readable and maintainable JavaScript code with the special command '.code'. Taiko tests web applications without depending on the internal page structure.

To

Taiko's .code command generates readable and maintainable JavaScript code.