Skip to content

Commit e618fb5

Browse files
committed
ajustes
1 parent 606d19d commit e618fb5

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/workflow-pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ jobs:
5757
- name: Run E2E Tests
5858
run: npm run test:e2e
5959
env:
60+
# 🤖 INJEÇÃO DA IA AQUI!
61+
AZURE_AI_TOKEN: ${{ secrets.AZURE_AI_TOKEN }}
6062
BASE_URL: ${{ secrets.BASE_URL }}
6163
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
6264
SAUCE_PASSWORD: ${{ secrets.SAUCE_PASSWORD }}
65+
CI: "true" # Garante modo Headless
6366

6467
# Upload do JSON para o Allure
6568
- uses: actions/upload-artifact@v4

envs/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ HEADLESS=false
1414
K6_BASE_URL=https://httpbin.org
1515

1616
# Token de acesso para GitHub AI
17-
GITHUB_AI_TOKEN=ghp_yourtokenhere
17+
AZURE_AI_TOKEN=ghp_yourtokenhere

pages/BasePages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class BasePage {
3838
await this.page.waitForSelector(selector, { state: 'visible', timeout: 5000 });
3939
await this.page.click(selector);
4040
} catch (error: any) {
41-
if (!process.env.GITHUB_AI_TOKEN) throw error;
41+
if (!process.env.AZURE_AI_TOKEN) throw error;
4242

4343
console.warn(`[Self-Healing] 🚑 Falha ao clicar em: '${contextDescription}'. Chamando IA...`);
4444

services/AIService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export class AIService {
33
private readonly token: string;
44

55
constructor() {
6-
this.token = process.env.GITHUB_AI_TOKEN || "";
7-
if (!this.token) console.warn("[AIService] ⚠️ Token GITHUB_AI_TOKEN não encontrado!");
6+
this.token = process.env.AZURE_AI_TOKEN || "";
7+
if (!this.token) console.warn("[AIService] ⚠️ Token AZURE_AI_TOKEN não encontrado!");
88
}
99

1010
async analyzeFailure(errorMessage: string, domSnapshot: string): Promise<string> {

tests/e2e/support/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ After(async function (scenario) {
8585
}
8686

8787
// IA entra em ação se houver falha
88-
if (process.env.GITHUB_AI_TOKEN) {
88+
if (process.env.AZURE_AI_TOKEN) {
8989
if (!this.pageManager) return;
9090

9191
try {

0 commit comments

Comments
 (0)