- Generate OneShot js code geenrator - Introduced a new C4A-Script tutorial example for login flow using Blockly. - Updated index.html to include Blockly theme and event editor modal for script editing. - Created a test HTML file for testing Blockly integration. - Added comprehensive C4A-Script API reference documentation covering commands, syntax, and examples. - Developed core documentation for C4A-Script, detailing its features, commands, and real-world examples. - Updated mkdocs.yml to include new C4A-Script documentation in navigation.
36 lines
834 B
Plaintext
36 lines
834 B
Plaintext
# Login flow with error handling
|
|
# Demonstrates procedures, variables, and conditional checks
|
|
|
|
# Define login procedure
|
|
PROC perform_login
|
|
CLICK `input#email`
|
|
TYPE $email
|
|
CLICK `input#password`
|
|
TYPE $password
|
|
CLICK `button.login-submit`
|
|
ENDPROC
|
|
|
|
# Set credentials
|
|
SET email = "user@example.com"
|
|
SET password = "securePassword123"
|
|
|
|
# Navigate to login page
|
|
GO https://app.example.com/login
|
|
WAIT `.login-container` 15
|
|
|
|
# Attempt login
|
|
perform_login
|
|
|
|
# Wait for page to load
|
|
WAIT 3
|
|
|
|
# Check if login was successful
|
|
EVAL `
|
|
if (document.querySelector('.dashboard')) {
|
|
console.log('Login successful - on dashboard');
|
|
} else if (document.querySelector('.error-message')) {
|
|
console.log('Login failed:', document.querySelector('.error-message').textContent);
|
|
} else {
|
|
console.log('Unknown state after login');
|
|
}
|
|
` |