Tạo báo cáo html bằng javascript

Có hai cách để truy xuất dữ liệu thực mà bạn muốn xem, mà bạn kiểm soát bằng cách sử dụng phần Tùy chọn JavaScript của trình chỉnh sửa nguồn, được khoanh tròn màu đỏ ở cuối ảnh chụp màn hình sau

Tạo báo cáo html bằng javascript

  • Nếu Sử dụng API GetData được chọn (cài đặt mặc định), bạn có thể chuyển dữ liệu qua một hoặc nhiều biến đổi trước khi truy xuất dữ liệu đó. Khi được chọn, bạn chuyển cấu hình truy vấn cho LABKEY. Truy vấn. Lấy dữ liệu. getRawData()
  • Nếu Sử dụng API GetData không được chọn, bạn vẫn có thể định cấu hình các cột và bộ lọc trước khi chuyển trực tiếp cấu hình truy vấn tới LABKEY. Truy vấn. selectRows()

Sửa đổi cấu hình truy vấn

Trước khi dữ liệu được truy xuất, cấu hình truy vấn có thể được sửa đổi khi cần. Ví dụ: bạn có thể chỉ định bộ lọc, cột, sắp xếp, số hàng tối đa cần trả về, v.v. Ví dụ dưới đây chỉ định rằng chỉ 25 hàng đầu tiên của kết quả sẽ được trả về

queryConfig.maxRows = 25;

Mã của bạn cũng nên thêm các tham số vào cấu hình truy vấn để chỉ định các hàm sẽ gọi khi selectRows thành công hay thất bại. Ví dụ

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

Phạm vi JavaScript

Mã JavaScript của bạn được bọc trong một hàm ẩn danh, cung cấp phạm vi duy nhất cho các hàm và biến bạn xác định;

Thí dụ

Ví dụ này có thể được đính kèm vào bất kỳ tập dữ liệu hoặc danh sách nào. Để chạy mẫu này, hãy chọn tập dữ liệu hoặc danh sách để chạy, tạo báo cáo JavaScript (xem ở trên), dán mã mẫu này vào tab Nguồn

Dự án này dựa trên dự án https. //www. npmjs. com/package/multiple-cucumber-html-reporter Như với dự án ban đầu, html-cucumber-report-generator là một mô-đun báo cáo để Cucumber phân tích cú pháp đầu ra JSON thành một báo cáo đẹp mắt. Sự khác biệt giữa dự án trước và dự án này là những điều sau đây

  • được viết bằng bản đánh máy
  • tùy chọn để hiển thị các kịch bản Phác thảo theo cách được nhóm

Tạo báo cáo html bằng javascript

  • Tùy chọn lưu trữ các báo cáo trong cơ sở dữ liệu mongodb và truy cập chúng từ một trang web
  • Chủ đề tối và sáng

Tạo báo cáo html bằng javascript
Tạo báo cáo html bằng javascript

Bạn có thể tìm thấy mẫu có chủ đề tối và siêu dữ liệu báo cáo tại đây và mẫu có chủ đề sáng và siêu dữ liệu báo cáo có thể tìm thấy tại đây

Và một mẫu có chủ đề tối không có siêu dữ liệu báo cáo có thể được tìm thấy tại đây và một mẫu có chủ đề sáng không có siêu dữ liệu báo cáo có thể được tìm thấy tại đây

Cài đặt

Cài đặt mô-đun này cục bộ bằng lệnh sau

npm install cucumber-html-report-generator

Lưu vào phần phụ thuộc hoặc phần phụ thuộc nhà phát triển

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev

khả năng tương thích

Trình báo cáo HTML Multiple Cucumber đã được thử nghiệm với phiên bản webdriverio 7 mới nhất. 10 và nó sẽ hoạt động với các phiên bản dưa chuột mới nhất. Để sử dụng với webdriverwio có một phóng viên. wdio-dưa chuột-html-phóng viên

QUAN TRỌNG

Đảm bảo rằng, khi bạn tạo các tệp JSON bằng Cucumber, mỗi tệp sẽ có một tên ĐỘC ĐÁO. Nếu bạn không cung cấp tên duy nhất, Cucumber sẽ ghi đè tệp JSON

Lời khuyên là sử dụng ví dụ như tên của tính năng, tên của trình duyệt/thiết bị mà nó đang chạy VÀ dấu thời gian unix với ví dụ này

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
6. Điều này sẽ dẫn đến kết quả như thế này
  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
7

dự án ví dụ

webdriverio-cucumber-typescript

Tùy chọn

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
8

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Nếu đúng, nó sẽ hiển thị thời gian thực hiện trong trang tóm tắt tính năng và trong chi tiết tính năng

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev
0

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Nếu đúng, báo cáo đã tạo sẽ được mở trong trình duyệt mặc định

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev
2

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Tùy chọn này được sử dụng cùng với tùy chọn trước đó. Trong trường hợp báo cáo được tạo chỉ có một tính năng, báo cáo sẽ mở trực tiếp trong chi tiết tính năng

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev
4

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không
  • Tùy chọn. Ánh sáng tối

Với tùy chọn này, có thể chọn chủ đề của báo cáo, theo mặc định, nếu không bao gồm thuộc tính si thì nó được chọn chủ đề tối. Bạn có thể chọn chủ đề ánh sáng với giá trị 'Ánh sáng'

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev
6

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không

Với tùy chọn này, có thể chuyển css kiểu tùy chỉnh vào báo cáo. Phong cách này sẽ được sao chép ở cuối phong cách hiện tại. Thêm nó như thế này

npm install cucumber-html-report-generator --save
npm install cucumber-html-report-generator --save-dev
8

npm install cucumber-html-report-generator --save npm install cucumber-html-report-generator --save-dev9

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    0
  • Bắt buộc. Không

Nếu bạn cần thay thế kiểu mặc định cho báo cáo của mình. Thêm nó như thế này

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
1

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
2

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không

Sử dụng tùy chọn này có thể chỉ ra đường dẫn nơi báo cáo sẽ được tạo. Khi không có giá trị nào được cung cấp thì báo cáo sẽ được tạo trong thư mục Cucumber-html-report-generator/YYYY-MM-DD_HH-mm-ss

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
4

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Điều này sẽ vô hiệu hóa nhật ký nên sẽ KHÔNG thấy điều này

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

8

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
6

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Với giá trị thực, tài nguyên html được lấy từ cdn và với giá trị sai, chúng được lấy từ thư mục con trong vị trí báo cáo

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
8

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không
  • Giá trị mặc định. Sai

Đó là tiêu đề trang tính năng và nó có giá trị mặc định "Trình tạo báo cáo HTML dưa chuột"

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

80

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Đúng

Đây là thư mục chứa các tệp json kết quả thực thi dưa chuột

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

82

  • Loại hình.
    . . .
    queryConfig.success = onSuccess;
    queryConfig.error = onError;
    . . .

    function onSuccess(results)
    {
    . . .Render results as HTML to div. . .
    }

    function onError(errorInfo)
    {
    jsDiv.innerHTML = errorInfo.exception;
    }

    83
  • Bắt buộc. Không

Nó hiển thị một tiêu đề tùy chỉnh trong báo cáo. Nếu tham số này không được cung cấp, giá trị "Dữ liệu bổ sung" và có một giá trị hợp lệ trong tham số reportMetadata khác với null

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

84

  • Loại hình.
    . . .
    queryConfig.success = onSuccess;
    queryConfig.error = onError;
    . . .

    function onSuccess(results)
    {
    . . .Render results as HTML to div. . .
    }

    function onError(errorInfo)
    {
    jsDiv.innerHTML = errorInfo.exception;
    }

    85
  • Bắt buộc. Không

Đó là siêu dữ liệu sẽ được đưa vào báo cáo. Siêu dữ liệu phải được cung cấp dưới dạng một đối tượng với các thuộc tính. - tên - giá trị - biểu tượng (tùy chọn)

Giá trị biểu tượng có thể được lấy từ trang sau. https. // phông chữ tuyệt vời. com/v5. 15/icons?d=gallery&p=2&m=free

npm install cucumber-html-report-generator
8

Thêm siêu dữ liệu vào JSON dưa chuột

Để có thể thấy điều này, bạn sẽ cần thêm phần sau vào JSON dưa chuột trước khi lưu nó

npm install cucumber-html-report-generator
9

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

86

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không

Đây là thư mục chứa các tệp tính năng

. . .
queryConfig.success = onSuccess;
queryConfig.error = onError;
. . .

function onSuccess(results)
{
. . .Render results as HTML to div. . .
}

function onError(errorInfo)
{
jsDiv.innerHTML = errorInfo.exception;
}

88

  • Loại hình.
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9
  • Bắt buộc. Không

Với tham số này, sẽ quyết định xem báo cáo có được lưu trong cơ sở dữ liệu mongoDb được chỉ định với tham số mongooseServerUrl hay không. Giá trị mặc định là sai

npm install cucumber-html-report-generator80

  • Loại hình.
    npm install cucumber-html-report-generator
    81
  • Bắt buộc. Không

Trước tiên, mô-đun này sẽ hợp nhất tất cả các tệp JSON thành 1 tệp, sau đó làm phong phú thêm tệp đó bằng dữ liệu được sử dụng cho báo cáo. Nếu

npm install cucumber-html-report-generator
82, JSON được hợp nhất sẽ được lưu trong
  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
2. Chúng sẽ được lưu dưới dạng

  • npm install cucumber-html-report-generator
    84

npm install cucumber-html-report-generator
85

  • Loại hình.

      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    9

  • Bắt buộc. Không

  • npm install cucumber-html-report-generator
    87

Nó cho phép lưu báo cáo json của các báo cáo json dưa chuột đã tham gia với các thông số kỹ thuật để tạo báo cáo html trong thư mục báo cáo. Chúng sẽ được lưu dưới dạng

npm install cucumber-html-report-generator
88

  • Loại hình.
    npm install cucumber-html-report-generator --save
    npm install cucumber-html-report-generator --save-dev
    5
  • Bắt buộc. Không

Nó xác định url của máy chủ mongodb. nếu không có giá trị nào được cung cấp thì giá trị http. //máy chủ cục bộ. 3000. Nó phụ thuộc vào dự án x

Câu hỏi thường gặp

Chỉ có 1 báo cáo được hiển thị trong bảng tổng quan về tính năng

Có thể tên của tệp JSON dưa chuột đã được lưu không phải là duy nhất (đủ)

Lời khuyên của tôi là sử dụng ví dụ

  • tên của tính năng
  • tên của trình duyệt/thiết bị mà nó đang chạy trên đó
  • một dấu thời gian unix với ví dụ này
      showExecutionTime?: boolean;
      openReportInBrowser?: boolean;
      navigateToFeatureIfThereIsOnlyOne?: boolean;
      theme?: string;
      customStyle?: string;
      overrideStyle?: string;
      reportPath?: string;
      disableLog?: boolean;
      useCDN?: boolean;
      reportTitle?: string;
      jsonDir: string;
      reportMetadataTitle?: string;
      reportMetadata?: Metadata[];
      featuresFolder?: string;
      saveReportInMongoDb?: boolean;
      saveCollectedJSON?: boolean;
      saveEnrichedJSON?: boolean;
      mongooseServerUrl?:string;
    
    6

Điều này sẽ dẫn đến kết quả như thế này

  showExecutionTime?: boolean;
  openReportInBrowser?: boolean;
  navigateToFeatureIfThereIsOnlyOne?: boolean;
  theme?: string;
  customStyle?: string;
  overrideStyle?: string;
  reportPath?: string;
  disableLog?: boolean;
  useCDN?: boolean;
  reportTitle?: string;
  jsonDir: string;
  reportMetadataTitle?: string;
  reportMetadata?: Metadata[];
  featuresFolder?: string;
  saveReportInMongoDb?: boolean;
  saveCollectedJSON?: boolean;
  saveEnrichedJSON?: boolean;
  mongooseServerUrl?:string;
7

Ưu điểm của việc này là khi bạn nhìn vào thư mục lưu các tệp JSON của Cucumber, bạn có thể thấy

  • các tính năng đã được thực hiện
  • trên trình duyệt nào
  • dấu thời gian để xem tính năng nào được thực hiện sau cùng (nếu tên tính năng và trình duyệt giống nhau)

Cách đính kèm Ảnh chụp màn hình vào báo cáo HTML

Bạn có thể đính kèm ảnh chụp màn hình vào tệp JSON của Cucumber bất cứ lúc nào. Chỉ cần tạo một móc dưa chuột

npm install cucumber-html-report-generator
92 sẽ xử lý việc này. Bạn có thể thêm chúng trong khi chạy hoặc khi một
npm install cucumber-html-report-generator
92 bị lỗi

Kiểm tra khung bạn đang sử dụng để đính kèm ảnh chụp màn hình vào tệp JSON

Cách đính kèm văn bản thuần túy vào báo cáo HTML

Bạn có thể đính kèm văn bản/dữ liệu thuần túy bất kỳ lúc nào vào tệp JSON của Cucumber để giúp gỡ lỗi/xem lại kết quả. Bạn có thể thêm chúng trong khi chạy hoặc khi một

npm install cucumber-html-report-generator
92 bị lỗi

Kiểm tra khung bạn đang sử dụng để đính kèm văn bản thuần túy vào tệp JSON

Cách đính kèm JSON đẹp vào báo cáo HTML

Bạn có thể đính kèm JSON bất cứ lúc nào vào tệp JSON của Cucumber. Bạn có thể thêm chúng trong khi chạy hoặc khi một

npm install cucumber-html-report-generator
92 bị lỗi

Bạn có thể tạo HTML bằng Javascript không?

Một người có thể giải quyết cùng một vấn đề bằng nhiều chiến lược khác nhau Tạo Html bằng Javascript. Không có cách nào đúng để làm điều đó . Trong các đoạn tiếp theo, chúng ta sẽ thảo luận về nhiều giải pháp thay thế khác nhau cho vấn đề hiện tại. // Các nút văn bản có thể được tạo bằng phương thức "write" document.

Định dạng báo cáo HTML là gì?

Đơn giản, đó là một loạt thẻ thống nhất định dạng của tài nguyên web lộn xộn, chẳng hạn như văn bản, hoạt ảnh, âm thanh, bảng, liên kết, v.v.. HTML Report can be defined as using HTML language to make reports on the web or the reports generated by HTML report generators.

HTML của bạn là gì?

Giới thiệu HTML . the standard markup language for creating Web pages.