Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Keep LocalStorage

未關閉
#2,968 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
30/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
javascript, node.js
領域
testing

研究方向

從 Puppeteer helper 和所示設定開始,尤其關注 keepBrowserState 如何處理不同情境之間的 cookie 和瀏覽器狀態。追蹤 LocalStorage 在哪裡被重設或保留;完成標準是 LocalStorage 在相關測試之間以與 cookie 相同的方式持久存在,並且有涵蓋該行為的測試。

由索引模型根據 Issue 內容生成。

描述

What are you trying to achieve?

i want keep LocalStorage like keepCookies

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

My First Test --
  test something
    我 在页面 "https://....com/"
    我 保存屏幕截图 "see-first.jpg"
    我 看到 "text"
    我 等 2
    我 单击 "客户/广告主", ".ant-btn"
    我 wait for navigation 
    我 等待元素 ".right", 5
    我 单击 "账号登录", ".right"
    我 单击 "密码登录", ".TabR"
    我 填写字段 "#Authorize_username", "[email protected]"
    我 填写字段 "#Authorize_password", "123456"
    我 单击 "立即登录", ".ant-btn-primary"
    我 等 5
    我 保存屏幕截图 "see-chengfayun.jpg"
  ✔ OK in 14313ms

Provide test source code if related

// paste test
Feature('My First Test');

Scenario('test something', ({ I }) => {
  I.amOnPage('https://....com/');
  I.saveScreenshot("see-first.jpg")
  I.see('text');
  I.wait(2);
  I.click('客户/广告主', '.ant-btn');
  I.waitForNavigation();
  I.waitForElement('.right', 5);
  I.click('账号登录', '.right');
  I.click('密码登录', '.TabR');
  I.fillField('#Authorize_username', '[email protected]');
  I.fillField('#Authorize_password', '123456');
  I.click('立即登录', '.ant-btn-primary');
  I.wait(5)
  //截图
  I.saveScreenshot("see-chengfayun.jpg")
});
Details
  • CodeceptJS version: 3.0.7
  • NodeJS Version: v14.16.1
  • Operating System: macos
  • puppeteer
  • Configuration file:
# paste config here
exports.config = {
  tests: './*_test.js',
  output: './output',
  helpers: {
    Puppeteer: {
      url: 'http://localhost',
      show: true,
      windowSize: '1200x900',
      keepBrowserState: true,
    }
  },
  include: {
    I: './steps_file.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'PuppeteerTests',
  translation: 'zh-CN',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    }
  }
}
主要語言
JavaScript
星號
4.2k
分支
756
平均合併
1 天 6 小時
30 天內合併 PR
19

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

codeceptjs/CodeceptJS 的其他 Issue

查看 codeceptjs/CodeceptJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。